diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/secure_token_test.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/cases/secure_token_test.rb b/activerecord/test/cases/secure_token_test.rb index ff0072d59c..239b975d82 100644 --- a/activerecord/test/cases/secure_token_test.rb +++ b/activerecord/test/cases/secure_token_test.rb @@ -30,13 +30,17 @@ class SecureTokenTest < ActiveRecord::TestCase assert_equal @user.token, "custom-secure-token" end - def test_token_with_if_condition_checks_condition_on_save + def test_failing_if_condition_does_not_set_token @user.token_condition = false @user.save + assert_nil @user.conditional_token + end + def test_passing_if_condition_sets_token @user.token_condition = true @user.save + assert_not_nil @user.conditional_token end end |