aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-03-07 07:03:59 -0800
committerJosé Valim <jose.valim@gmail.com>2012-03-07 16:08:26 +0100
commit524e8a1a802d773f59cb6bb6466c8f6486084340 (patch)
tree6c48d5395cf0446eb1a379a0fda602752c559328 /activerecord/test/cases
parent3775058f1fde8dfb476fe7304fd9cfe7b45e8d8a (diff)
downloadrails-524e8a1a802d773f59cb6bb6466c8f6486084340.tar.gz
rails-524e8a1a802d773f59cb6bb6466c8f6486084340.tar.bz2
rails-524e8a1a802d773f59cb6bb6466c8f6486084340.zip
Merge pull request #5316 from Jacobkg/master
Update ActiveRecord::AttributeMethods#attribute_present? to return false for empty strings
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index cdff7ef017..acb9a44305 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -30,9 +30,12 @@ class AttributeMethodsTest < ActiveRecord::TestCase
t = Topic.new
t.title = "hello there!"
t.written_on = Time.now
+ t.author_name = ""
assert t.attribute_present?("title")
assert t.attribute_present?("written_on")
assert !t.attribute_present?("content")
+ assert !t.attribute_present?("author_name")
+
end
def test_attribute_present_with_booleans