2008-06-01 18:22:39 -04:00
|
|
|
IN: furnace.auth.providers.db.tests
|
|
|
|
USING: furnace.actions
|
2008-06-16 04:34:17 -04:00
|
|
|
furnace.auth
|
2008-06-01 18:22:39 -04:00
|
|
|
furnace.auth.login
|
|
|
|
furnace.auth.providers
|
|
|
|
furnace.auth.providers.db tools.test
|
2008-03-06 04:03:07 -05:00
|
|
|
namespaces db db.sqlite db.tuples continuations
|
2008-12-15 04:33:04 -05:00
|
|
|
io.files io.files.temp io.directories accessors kernel ;
|
2008-03-06 04:00:10 -05:00
|
|
|
|
2008-06-16 04:34:17 -04:00
|
|
|
<action> "test" <login-realm> realm set
|
2008-03-06 04:00:10 -05:00
|
|
|
|
2008-04-29 22:04:06 -04:00
|
|
|
[ "auth-test.db" temp-file delete-file ] ignore-errors
|
|
|
|
|
2008-10-02 13:51:21 -04:00
|
|
|
"auth-test.db" temp-file <sqlite-db> [
|
2008-03-11 04:39:09 -04:00
|
|
|
|
2008-06-13 21:54:52 -04:00
|
|
|
user ensure-table
|
2008-03-06 04:00:10 -05:00
|
|
|
|
2008-03-11 04:39:09 -04:00
|
|
|
[ t ] [
|
2008-04-29 22:04:06 -04:00
|
|
|
"slava" <user>
|
2008-05-01 17:24:50 -04:00
|
|
|
"foobar" >>encoded-password
|
2008-03-17 05:31:13 -04:00
|
|
|
"slava@factorcode.org" >>email
|
2008-04-29 22:04:06 -04:00
|
|
|
H{ } clone >>profile
|
2008-05-01 17:24:50 -04:00
|
|
|
users new-user
|
2008-03-17 05:31:13 -04:00
|
|
|
username>> "slava" =
|
2008-03-11 04:39:09 -04:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[ f ] [
|
2008-04-29 22:04:06 -04:00
|
|
|
"slava" <user>
|
|
|
|
H{ } clone >>profile
|
2008-05-01 17:24:50 -04:00
|
|
|
users new-user
|
2008-03-11 04:39:09 -04:00
|
|
|
] unit-test
|
|
|
|
|
2008-05-01 17:24:50 -04:00
|
|
|
[ f ] [ "fdasf" "slava" check-login >boolean ] unit-test
|
2008-03-06 04:00:10 -05:00
|
|
|
|
2008-05-01 17:24:50 -04:00
|
|
|
[ ] [ "foobar" "slava" check-login "user" set ] unit-test
|
2008-03-17 05:31:13 -04:00
|
|
|
|
|
|
|
[ t ] [ "user" get >boolean ] unit-test
|
2008-03-06 04:00:10 -05:00
|
|
|
|
2008-05-01 17:24:50 -04:00
|
|
|
[ ] [ "user" get "fdasf" >>encoded-password drop ] unit-test
|
2008-03-06 04:00:10 -05:00
|
|
|
|
2008-05-01 17:24:50 -04:00
|
|
|
[ ] [ "user" get users update-user ] unit-test
|
2008-03-06 04:00:10 -05:00
|
|
|
|
2008-05-01 17:24:50 -04:00
|
|
|
[ t ] [ "fdasf" "slava" check-login >boolean ] unit-test
|
2008-03-06 04:00:10 -05:00
|
|
|
|
2008-05-01 17:24:50 -04:00
|
|
|
[ f ] [ "foobar" "slava" check-login >boolean ] unit-test
|
2008-03-06 04:00:10 -05:00
|
|
|
] with-db
|