diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-02-13 08:40:53 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-02-13 08:40:53 +0100 |
commit | d0326bbae53b4ef6686e02d4e675e8fb74afeb53 (patch) | |
tree | 4abd7ffef91df952c0e3a4817668b4701fb8cd8d /activerecord/test/cases | |
parent | 9e30346b3a225c8b717ed7cf95ba17aacd211c26 (diff) | |
parent | 0817bb06f72bac456a7225645caf18ae9dc8c040 (diff) | |
download | rails-d0326bbae53b4ef6686e02d4e675e8fb74afeb53.tar.gz rails-d0326bbae53b4ef6686e02d4e675e8fb74afeb53.tar.bz2 rails-d0326bbae53b4ef6686e02d4e675e8fb74afeb53.zip |
Merge pull request #18918 from morgoth/do-not-overwrite-value-of-secret-token-when-present
Do not overwrite secret token value when already present.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/secure_token_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/secure_token_test.rb b/activerecord/test/cases/secure_token_test.rb index 3f7455d12d..e731443fc2 100644 --- a/activerecord/test/cases/secure_token_test.rb +++ b/activerecord/test/cases/secure_token_test.rb @@ -22,4 +22,11 @@ class SecureTokenTest < ActiveRecord::TestCase assert_not_equal @user.token, old_token assert_not_equal @user.auth_token, old_auth_token end + + def test_token_value_not_overwritten_when_present + @user.token = "custom-secure-token" + @user.save + + assert_equal @user.token, "custom-secure-token" + end end |