Commit 4ce8287e authored by Jacob Vosmaer's avatar Jacob Vosmaer

Add failing spec for upper case LDAP emails

parent b3f8a03c
...@@ -50,6 +50,14 @@ describe Gitlab::LDAP::Access do ...@@ -50,6 +50,14 @@ describe Gitlab::LDAP::Access do
updated.should == false updated.should == false
end end
it "should not update the email if the user has the same email GitLab and in LDAP, but with upper case in LDAP" do
entry = Net::LDAP::Entry.new
entry['mail'] = [user_ldap.email.upcase]
Gitlab::LDAP::Adapter.any_instance.stub(:user) { Gitlab::LDAP::Person.new(entry) }
updated = access.update_email(user_ldap)
updated.should == false
end
it "should update the email if the user email is different" do it "should update the email if the user email is different" do
entry = Net::LDAP::Entry.new entry = Net::LDAP::Entry.new
entry['mail'] = ["new_email@example.com"] entry['mail'] = ["new_email@example.com"]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment