1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use @existing_user while updating existing user, fixing - #ee4e86

This commit is contained in:
Akshay Vishnoi 2014-06-14 14:42:52 +05:30
parent a041107bf5
commit 9bc91260ac

View file

@ -92,15 +92,15 @@ class SecurePasswordTest < ActiveModel::TestCase
end end
test "update an existing user with validations and valid password/confirmation" do test "update an existing user with validations and valid password/confirmation" do
@user.password = 'password' @existing_user.password = 'password'
@user.password_confirmation = 'password' @existing_user.password_confirmation = 'password'
assert @user.valid?(:update), 'user should be valid' assert @existing_user.valid?(:update), 'user should be valid'
@user.password = 'a' * 72 @existing_user.password = 'a' * 72
@user.password_confirmation = 'a' * 72 @existing_user.password_confirmation = 'a' * 72
assert @user.valid?(:update), 'user should be valid' assert @existing_user.valid?(:update), 'user should be valid'
end end
test "updating an existing user with validation and a blank password" do test "updating an existing user with validation and a blank password" do