better consistency around email case sensitivity

This commit is contained in:
Régis Hanol
2013-04-15 02:20:33 +02:00
parent c6ab9fec9d
commit b24c1a1ad9
10 changed files with 62 additions and 35 deletions

View File

@ -36,7 +36,6 @@ describe Invite do
end
end
context 'to a topic' do
let!(:topic) { Fabricate(:topic) }
let(:inviter) { topic.user }
@ -97,8 +96,12 @@ describe Invite do
topic.invite_by_email(inviter, 'iceking@adventuretime.ooo').should == @invite
end
it 'matches case insensitively' do
topic.invite_by_email(inviter, 'ICEKING@adventuretime.ooo').should == @invite
it 'matches case insensitively for the domain part' do
topic.invite_by_email(inviter, 'iceking@ADVENTURETIME.ooo').should == @invite
end
it 'matches case sensitively for the local part' do
topic.invite_by_email(inviter, 'ICEKING@adventuretime.ooo').should_not == @invite
end
end