aboutsummaryrefslogtreecommitdiff
path: root/src/guff/api/test.cr
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-03-14 02:20:50 -0400
committerPaul Duncan <pabs@pablotron.org>2016-03-14 02:20:50 -0400
commitcf90fa002afec60e2c057348de24ca1d8bcbaaa4 (patch)
tree574b1df80a060a56946f45309956f3d63bbcfabe /src/guff/api/test.cr
parente88219d9a4bbc85563a2ead6708641de389af4fa (diff)
downloadold-guff-cf90fa002afec60e2c057348de24ca1d8bcbaaa4.tar.bz2
old-guff-cf90fa002afec60e2c057348de24ca1d8bcbaaa4.zip
add test/{get_users,set_user}, js/util.js, lots more
Diffstat (limited to 'src/guff/api/test.cr')
-rw-r--r--src/guff/api/test.cr38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/guff/api/test.cr b/src/guff/api/test.cr
index 7549c11..44b5e10 100644
--- a/src/guff/api/test.cr
+++ b/src/guff/api/test.cr
@@ -17,6 +17,44 @@ module Guff
[{foo: "bar"}, {foo: "asdf"}].to_json
end
+ MOCK_USERS = {
+ "users": [{
+ "id": "0",
+ "name": "Guest",
+ "active": true,
+ }, {
+ "id": "1",
+ "name": "Admin",
+ "active": false,
+ }, {
+ "id": "2",
+ "name": "Test User 1",
+ "active": false,
+ }, {
+ "id": "2",
+ "name": "Test User 2",
+ "active": false,
+ }, {
+ "id": "3",
+ "name": "Test User<<<<>>>>>&&&&&&2",
+ "active": false,
+ }]
+ }
+
+ private def do_test_get_users(
+ context : HTTP::Server::Context,
+ args : Hash(String, String)
+ )
+ MOCK_USERS
+ end
+
+ private def do_test_set_user(
+ context : HTTP::Server::Context,
+ args : Hash(String, String)
+ )
+ { ok: true }
+ end
+
private def do_test_error(
context : HTTP::Server::Context,
args : Hash(String, String)