summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorJakub Troszok <troszok@gmail.com>2012-06-24 22:51:58 +0200
committerJakub Troszok <troszok@gmail.com>2012-06-24 22:51:58 +0200
commitbea0583951157cc2d1f8923f5b1bc13837aaa24c (patch)
tree1f2ee086b424bef25a41ebd583e75fb298722407 /spec/models/user_spec.rb
parent56dbfd2af3174a94d0c5ed93a14dd3244370d2f0 (diff)
downloadgitlab-ce-bea0583951157cc2d1f8923f5b1bc13837aaa24c.tar.gz
Added tests for automatic password generation.
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 6fe96284eec..5d0b8cd8fdc 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -22,6 +22,12 @@ describe User do
user.identifier.should == "test_mail_com"
end
+ it "should generate password when password is empty" do
+ user = User.create(:email => "test1@mail.com")
+ user.password.should eql(user.password_confirmation)
+ user.password.should_not be_empty
+ end
+
it "should have authentication token" do
user = Factory(:user)
user.authentication_token.should_not == ""