Created
October 9, 2015 22:34
-
-
Save VelizarHristov/db1a2e42b837ee1339e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setup | |
FactoryGirl.create :customer, nickname: 'foo' | |
FactoryGirl.create :customer, nickname: 'bar' | |
FactoryGirl.create :customer, nickname: 'baz' | |
FactoryGirl.create :customer, nickname: 'foofoo' | |
FactoryGirl.create :customer, nickname: 'barBaz' | |
end | |
context "exists_by_nickname" do | |
should "be true sometimes" do | |
assert Customer.exists_by_nickname('foo') | |
assert Customer.exists_by_nickname('foofoo') | |
assert Customer.exists_by_nickname('baz') | |
end | |
should "be false sometimes" do | |
assert_not Customer.exists_by_nickname('foe') | |
assert_not Customer.exists_by_nickname('foof') | |
assert_not Customer.exists_by_nickname('fool') | |
end | |
should "be case insensitive" do | |
assert Customer.exists_by_nickname('barbaz') | |
assert Customer.exists_by_nickname('bARBaz') | |
assert Customer.exists_by_nickname('BaZ') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment