Commit bea0583951157cc2d1f8923f5b1bc13837aaa24c
1 parent
56dbfd2a
Exists in
master
and in
4 other branches
Added tests for automatic password generation.
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
spec/models/user_spec.rb
| ... | ... | @@ -22,6 +22,12 @@ describe User do |
| 22 | 22 | user.identifier.should == "test_mail_com" |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | + it "should generate password when password is empty" do | |
| 26 | + user = User.create(:email => "test1@mail.com") | |
| 27 | + user.password.should eql(user.password_confirmation) | |
| 28 | + user.password.should_not be_empty | |
| 29 | + end | |
| 30 | + | |
| 25 | 31 | it "should have authentication token" do |
| 26 | 32 | user = Factory(:user) |
| 27 | 33 | user.authentication_token.should_not == "" | ... | ... |