diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-16 18:42:51 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-16 18:42:51 +0200 |
| commit | 45b130fd28f60a67552121b2dfab227279615a26 (patch) | |
| tree | 246610a19ec31cccf92e3c9dd34f96a60a4571b8 | |
| parent | 79eaaa68dd5380d3572ed48e32e556531bfd49eb (diff) | |
Add some more tests for the login basics while refactoring
| -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 = {}) |
