added spec for periods in usernames; unpendify a couple of specs

This commit is contained in:
maxwell 2010-12-04 19:33:58 -08:00
parent b3ca504c40
commit b56b2fbd1b

View file

@ -99,15 +99,13 @@ describe User do
duplicate_user.should_not be_valid
end
it "keeps the original case" do
pending "do we want this?"
it "downcases username" do
user = Factory.build(:user, :username => "WeIrDcAsE")
user.should be_valid
user.username.should == "WeIrDcAsE"
user.username.should == "weirdcase"
end
it "fails if the requested username is only different in case from an existing username" do
pending "do we want this?"
duplicate_user = Factory.build(:user, :username => user.username.upcase)
duplicate_user.should_not be_valid
end
@ -128,6 +126,11 @@ describe User do
user.should_not be_valid
end
it 'should not contain periods' do
user = Factory.build(:user, :username => "kittens;")
user.should_not be_valid
end
it "can be 32 characters long" do
user = Factory.build(:user, :username => "hexagoooooooooooooooooooooooooon")
user.should be_valid