added spec for periods in usernames; unpendify a couple of specs
This commit is contained in:
parent
b3ca504c40
commit
b56b2fbd1b
1 changed files with 7 additions and 4 deletions
|
|
@ -99,15 +99,13 @@ describe User do
|
||||||
duplicate_user.should_not be_valid
|
duplicate_user.should_not be_valid
|
||||||
end
|
end
|
||||||
|
|
||||||
it "keeps the original case" do
|
it "downcases username" do
|
||||||
pending "do we want this?"
|
|
||||||
user = Factory.build(:user, :username => "WeIrDcAsE")
|
user = Factory.build(:user, :username => "WeIrDcAsE")
|
||||||
user.should be_valid
|
user.should be_valid
|
||||||
user.username.should == "WeIrDcAsE"
|
user.username.should == "weirdcase"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "fails if the requested username is only different in case from an existing username" do
|
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 = Factory.build(:user, :username => user.username.upcase)
|
||||||
duplicate_user.should_not be_valid
|
duplicate_user.should_not be_valid
|
||||||
end
|
end
|
||||||
|
|
@ -128,6 +126,11 @@ describe User do
|
||||||
user.should_not be_valid
|
user.should_not be_valid
|
||||||
end
|
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
|
it "can be 32 characters long" do
|
||||||
user = Factory.build(:user, :username => "hexagoooooooooooooooooooooooooon")
|
user = Factory.build(:user, :username => "hexagoooooooooooooooooooooooooon")
|
||||||
user.should be_valid
|
user.should be_valid
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue