aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-04-24 19:16:01 +0200
committerOscar Del Ben <info@oscardelben.com>2012-04-24 19:16:01 +0200
commit692b3b6b6a565a27b968db8027daabcc766cfede (patch)
tree2009b739bf14875d5e369bd104a9ab2edfb21e02 /activemodel/test
parent71bd5096beb541866dec7599865b5ea7a693482d (diff)
downloadrails-692b3b6b6a565a27b968db8027daabcc766cfede.tar.gz
rails-692b3b6b6a565a27b968db8027daabcc766cfede.tar.bz2
rails-692b3b6b6a565a27b968db8027daabcc766cfede.zip
Fix secure_password setter
Diffstat (limited to 'activemodel/test')
-rw-r--r--activemodel/test/cases/secure_password_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activemodel/test/cases/secure_password_test.rb b/activemodel/test/cases/secure_password_test.rb
index 4338a3fc53..c451cc1aca 100644
--- a/activemodel/test/cases/secure_password_test.rb
+++ b/activemodel/test/cases/secure_password_test.rb
@@ -19,6 +19,12 @@ class SecurePasswordTest < ActiveModel::TestCase
assert !@user.valid?, 'user should be invalid'
end
+ test "blank password doesn't override previous password" do
+ @user.password = 'test'
+ @user.password = ''
+ assert_equal @user.password, 'test'
+ end
+
test "password must be present" do
assert !@user.valid?
assert_equal 1, @user.errors.size