Skip to content

Commit

Permalink
Check that admin LDAP user is untouched after authentication (#5263).
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3634 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
jplang committed Apr 11, 2010
1 parent 71a4158 commit 9306f3e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/unit/user_test.rb
Expand Up @@ -128,9 +128,21 @@ def test_lock
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
Expand Down

0 comments on commit 9306f3e

Please sign in to comment.