diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-24 15:00:32 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-02-24 15:11:48 +0900 |
commit | 812e59bfa3a3462452b2b5e47e2937cd994f2aa9 (patch) | |
tree | e7269fdb396d3c6237674e95cc1225f3c775322a /activerecord/test | |
parent | 2328fb6695989cd52f9903a0e837a0b0bf3726ba (diff) | |
download | rails-812e59bfa3a3462452b2b5e47e2937cd994f2aa9.tar.gz rails-812e59bfa3a3462452b2b5e47e2937cd994f2aa9.tar.bz2 rails-812e59bfa3a3462452b2b5e47e2937cd994f2aa9.zip |
More exercise string attribute predicate tests for falsy strings
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 148c9dd347..12ff6d4826 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -433,6 +433,10 @@ class AttributeMethodsTest < ActiveRecord::TestCase end assert_equal true, Topic.new(author_name: "Name").author_name? + + ActiveModel::Type::Boolean::FALSE_VALUES.each do |value| + assert_predicate Topic.new(author_name: value), :author_name? + end end test "number attribute predicate" do |