From 45b130fd28f60a67552121b2dfab227279615a26 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 16 Jul 2026 18:42:51 +0200 Subject: Add some more tests for the login basics while refactoring --- test/models/user_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/models') 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 def test_should_authenticate_user assert_equal users(:quentin), User.authenticate('quentin', 'monkey') end + + def test_should_not_authenticate_wrong_password + assert_nil User.authenticate("quentin", "wrong password") + end + + def test_should_not_authenticate_unknown_user + assert_nil User.authenticate("nosuchuser", "monkey") + end protected def create_user(options = {}) -- cgit v1.3