From 812e59bfa3a3462452b2b5e47e2937cd994f2aa9 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 24 Feb 2019 15:00:32 +0900 Subject: More exercise string attribute predicate tests for falsy strings --- activerecord/test/cases/attribute_methods_test.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3