diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-07-08 13:56:07 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-07-08 14:12:27 +0300 |
commit | e62e68e25bb7b1281e20e228db66f7deace4330f (patch) | |
tree | 68eca51697a69c7aca81553c99deeab87cffd79d /activemodel/test | |
parent | e8682c5bf051517b0b265e446aa1a7eccfd47bf7 (diff) | |
download | rails-e62e68e25bb7b1281e20e228db66f7deace4330f.tar.gz rails-e62e68e25bb7b1281e20e228db66f7deace4330f.tar.bz2 rails-e62e68e25bb7b1281e20e228db66f7deace4330f.zip |
has_secure_password: use `recovery_password` instead of `activation_token`
Since we have `has_secure_token`, it is too confusing to use `_token`
suffix with `has_secure_password`.
Context https://github.com/rails/rails/pull/33307#discussion_r200807185
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/secure_password_test.rb | 6 | ||||
-rw-r--r-- | activemodel/test/models/user.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/activemodel/test/cases/secure_password_test.rb b/activemodel/test/cases/secure_password_test.rb index 327661a9ca..9ef1148be8 100644 --- a/activemodel/test/cases/secure_password_test.rb +++ b/activemodel/test/cases/secure_password_test.rb @@ -186,7 +186,7 @@ class SecurePasswordTest < ActiveModel::TestCase test "authenticate" do @user.password = "secret" - @user.activation_token = "new_token" + @user.recovery_password = "42password" assert_equal false, @user.authenticate("wrong") assert_equal @user, @user.authenticate("secret") @@ -194,8 +194,8 @@ class SecurePasswordTest < ActiveModel::TestCase assert_equal false, @user.authenticate_password("wrong") assert_equal @user, @user.authenticate_password("secret") - assert_equal false, @user.authenticate_activation_token("wrong") - assert_equal @user, @user.authenticate_activation_token("new_token") + assert_equal false, @user.authenticate_recovery_password("wrong") + assert_equal @user, @user.authenticate_recovery_password("42password") end test "Password digest cost defaults to bcrypt default cost when min_cost is false" do diff --git a/activemodel/test/models/user.rb b/activemodel/test/models/user.rb index 1ff3379153..bb1b187694 100644 --- a/activemodel/test/models/user.rb +++ b/activemodel/test/models/user.rb @@ -7,7 +7,7 @@ class User define_model_callbacks :create has_secure_password - has_secure_password :activation_token, validations: false + has_secure_password :recovery_password, validations: false - attr_accessor :password_digest, :activation_token_digest + attr_accessor :password_digest, :recovery_password_digest end |