Emails are case insensitive

This commit is contained in:
Neil Lalonde
2014-07-14 10:16:24 -04:00
parent 0c8025d513
commit 01a68f8cc7
18 changed files with 105 additions and 13 deletions

View File

@ -423,4 +423,16 @@ describe Category do
end
describe "find_by_email" do
it "is case insensitive" do
c1 = Fabricate(:category, email_in: 'lower@example.com')
c2 = Fabricate(:category, email_in: 'UPPER@EXAMPLE.COM')
c3 = Fabricate(:category, email_in: 'Mixed.Case@Example.COM')
Category.find_by_email('LOWER@EXAMPLE.COM').should == c1
Category.find_by_email('upper@example.com').should == c2
Category.find_by_email('mixed.case@example.com').should == c3
Category.find_by_email('MIXED.CASE@EXAMPLE.COM').should == c3
end
end
end