aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/secure_password_test.rb
diff options
context:
space:
mode:
authorUnathi Chonco <choncou@Unathis-MacBook-Pro.local>2016-10-12 09:01:57 +0800
committerUnathi Chonco <choncou@Unathis-MacBook-Pro.local>2016-10-12 09:01:57 +0800
commit9b63bf1dfda36c61802165b2683761d2bb0d2110 (patch)
tree0744ede2fb6aca01e23af43a7b17c96249ad79b2 /activemodel/test/cases/secure_password_test.rb
parent86a48b4da3cbd925d30b0fbe472edbda7171ea9e (diff)
downloadrails-9b63bf1dfda36c61802165b2683761d2bb0d2110.tar.gz
rails-9b63bf1dfda36c61802165b2683761d2bb0d2110.tar.bz2
rails-9b63bf1dfda36c61802165b2683761d2bb0d2110.zip
Remove method for regenerating a token, and update `#authenticate`.
This change now creates a method `#authenticate_XXX` where XXX is the configured attribute name on `#has_secure_password`. `#authenticate` is now an alias to this method when the attribute name is the default 'password'
Diffstat (limited to 'activemodel/test/cases/secure_password_test.rb')
-rw-r--r--activemodel/test/cases/secure_password_test.rb13
1 files changed, 2 insertions, 11 deletions
diff --git a/activemodel/test/cases/secure_password_test.rb b/activemodel/test/cases/secure_password_test.rb
index abbd182f66..279a908aeb 100644
--- a/activemodel/test/cases/secure_password_test.rb
+++ b/activemodel/test/cases/secure_password_test.rb
@@ -189,8 +189,8 @@ class SecurePasswordTest < ActiveModel::TestCase
assert !@user.authenticate("wrong")
assert @user.authenticate("secret")
- assert !@user.authenticate("wrong", :activation_token)
- assert @user.authenticate("new_token", :activation_token)
+ assert !@user.authenticate_activation_token("wrong")
+ assert @user.authenticate_activation_token("new_token")
end
test "Password digest cost defaults to bcrypt default cost when min_cost is false" do
@@ -219,13 +219,4 @@ class SecurePasswordTest < ActiveModel::TestCase
@user.password = "secret"
assert_equal BCrypt::Engine::MIN_COST, @user.password_digest.cost
end
-
- test "regenerate attribute method" do
- old_digest = @user.activation_token_digest
- @user.regenerate_activation_token
-
- assert_not_nil @user.activation_token
- assert_not_nil @user.activation_token_digest
- assert_not_equal old_digest, @user.activation_token_digest
- end
end