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
This commit is contained in:
parent
71a4158fd0
commit
9306f3ea6c
|
@ -128,9 +128,21 @@ class UserTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a successful authentication" do
|
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
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue