diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-04-11 13:54:42 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-04-11 13:54:42 +0000 |
commit | 9306f3ea6c4fca4f72117e5a5676f19f230772e8 (patch) | |
tree | ef3615f1229cb0065e87f9a28a1010321cc2a1f8 /test | |
parent | 71a4158fd0494e47e52ec701f7d40f5ae068f811 (diff) | |
download | redmine-9306f3ea6c4fca4f72117e5a5676f19f230772e8.tar.gz redmine-9306f3ea6c4fca4f72117e5a5676f19f230772e8.zip |
Check that admin LDAP user is untouched after authentication (#5263).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3634 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/user_test.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index f33c0af7d..f63716501 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -128,9 +128,21 @@ class UserTest < ActiveSupport::TestCase end context "with a successful authentication" do - should "create a new user account" do + should "create a new user account if it doesn't exist" do assert_difference('User.count') do - User.try_to_login('edavis', '123456') + user = User.try_to_login('edavis', '123456') + assert !user.admin? + end + end + + should "retrieve existing user" do + user = User.try_to_login('edavis', '123456') + user.admin = true + user.save! + + assert_no_difference('User.count') do + user = User.try_to_login('edavis', '123456') + assert user.admin? end end end |