git.fiddlerwoaroof.com
Browse code

token installer returns token

Greg Wiley authored on 03/05/2017 22:21:34
Showing 2 changed files
... ...
@@ -34,7 +34,7 @@ class impl : public installer_ifc {
34 34
             user user(found_user[0]);
35 35
             std::string token(generator_());
36 36
             tokens_.save(user, token);
37
-            return "123456";
37
+            return token;
38 38
         }
39 39
 };
40 40
 
... ...
@@ -62,10 +62,11 @@ int installs_token() {
62 62
     installer installer = installer::create (tokens, unistd, directory, generator);
63 63
 
64 64
     //when
65
-    installer.install_token();
65
+    std::string result = installer.install_token();
66 66
 
67 67
     //then
68 68
     check(test_tokens->captured_token == token, "installed wrong token");
69
+    check(result == token, "installer returned wrong token");
69 70
     succeed();
70 71
 }
71 72