diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-16 18:42:51 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-17 18:12:25 +0200 |
| commit | 2c9c0cb98050ba7577e2114076573f33ad8441e1 (patch) | |
| tree | d60d1e450b014134f55f4b69a9b3f6941137601b /test/models/user_test.rb | |
| parent | 219626d04cbfd977db087284f6d231cf5d359bf7 (diff) | |
Add some more tests for the login basics while refactoring
Diffstat (limited to 'test/models/user_test.rb')
| -rw-r--r-- | test/models/user_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 6e4d2d7..049892e 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb | |||
| @@ -54,6 +54,14 @@ class UserTest < ActiveSupport::TestCase | |||
| 54 | def test_should_authenticate_user | 54 | def test_should_authenticate_user |
| 55 | assert_equal users(:quentin), User.authenticate('quentin', 'monkey') | 55 | assert_equal users(:quentin), User.authenticate('quentin', 'monkey') |
| 56 | end | 56 | end |
| 57 | |||
| 58 | def test_should_not_authenticate_wrong_password | ||
| 59 | assert_nil User.authenticate("quentin", "wrong password") | ||
| 60 | end | ||
| 61 | |||
| 62 | def test_should_not_authenticate_unknown_user | ||
| 63 | assert_nil User.authenticate("nosuchuser", "monkey") | ||
| 64 | end | ||
| 57 | 65 | ||
| 58 | protected | 66 | protected |
| 59 | def create_user(options = {}) | 67 | def create_user(options = {}) |
