From 4d92cbfe32ef6ee24547401cc06994baa84a24aa Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 22 Jun 2017 15:41:02 -0700 Subject: incremental --- src/token_authorization_middleware_test.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/token_authorization_middleware_test.cpp') diff --git a/src/token_authorization_middleware_test.cpp b/src/token_authorization_middleware_test.cpp index 49933c9..e3a18f1 100644 --- a/src/token_authorization_middleware_test.cpp +++ b/src/token_authorization_middleware_test.cpp @@ -6,13 +6,7 @@ using namespace crow; using namespace std; -class KnownLoginAuthenticator { - public: - inline bool authenticate(const std::string& username, - const std::string& password) { - return (username == "dude") && (password == "foo"); - } -}; + // Tests that static urls are correctly passed TEST(TokenAuthentication, TestBasicReject) { @@ -185,6 +179,15 @@ TEST(TokenAuthentication, TestPostBadLoginUrl) { app.stop(); } +// Test class that allows login for a fixed password. +class KnownLoginAuthenticator { + public: + inline bool authenticate(const std::string& username, + const std::string& password) { + return (username == "dude") && (password == "foo"); + } +}; + TEST(TokenAuthentication, TestSuccessfulLogin) { App> app; app.bindaddr("127.0.0.1").port(45451); -- cgit v1.2.3