diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-05-27 13:35:10 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-05-31 12:29:39 +0200 |
commit | 046bc843cbe26a7d8b47d586416e41a9def60327 (patch) | |
tree | d32fe80f3c566a0da2e2645f1918157bef348fe6 /spec | |
parent | Add developer role (diff) | |
download | recruiting-webapp-046bc843cbe26a7d8b47d586416e41a9def60327.tar.gz recruiting-webapp-046bc843cbe26a7d8b47d586416e41a9def60327.tar.bz2 recruiting-webapp-046bc843cbe26a7d8b47d586416e41a9def60327.zip |
Make users with empty nick and openid valid
Bug
https://bugs.gentoo.org/show_bug.cgi?id=368617
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/user_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 89d5beb..e6724d8 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -347,4 +347,30 @@ describe User do Factory(:answer, :owner => recruit, :question => q2) recruit.progress.should == "Answered 2 of 2 questions." end + + it "should allow many users with empty nick and openid" do + r1 = Factory(:recruit) + r2 = Factory(:recruit) + + r1.nick.should be_nil + r1.openid.should be_nil + r1.should be_valid + + r2.nick.should be_nil + r2.openid.should be_nil + r2.should be_valid + + r1.id.equal?(r2.id).should be_false + + u3 = Factory(:recruit, :nick => '', :openid => '') + u3.nick.should_not be_nil + u3.openid.should_not be_nil + u3.should be_valid + + u4 = User.new(:name => 'example', :email_address => 'example@example.com', :nick => '', :openid => '') + u4.nick.should_not be_nil + u4.openid.should_not be_nil + u4.should be_valid + u4.save! + end end |