From f6a068fdcef8b7650f010e4bb52f52a3b566e4bd Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 1 Apr 2016 20:08:00 -0400 Subject: add login test --- src/guff/api/test.cr | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/guff/api/test.cr') diff --git a/src/guff/api/test.cr b/src/guff/api/test.cr index 059f670..448cadf 100644 --- a/src/guff/api/test.cr +++ b/src/guff/api/test.cr @@ -82,7 +82,7 @@ module Guff::API::TestAPI user_id = @models.user.add_user(args["name"].not_nil!, active: args["active"]? ? args["active"] == "t" : nil, role: args["role"]?, - email: args["name"]?, + email: args["email"]?, password: args["password"]?, ) { "ok": true, "user_id": user_id } @@ -120,4 +120,12 @@ module Guff::API::TestAPI @models.user.remove_login(args["user_id"].to_i) { "ok": true } end + + private def do_test_login( + context : HTTP::Server::Context, + args : Hash(String, String) + ) + user_id = @models.user.login(args["email"], args["password"]).to_i + { "ok": true, "user_id": user_id } + end end -- cgit v1.2.3