aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stuart <tom@experthuman.com>2012-01-11 09:41:46 +0000
committerTom Stuart <tom@experthuman.com>2012-01-11 09:41:46 +0000
commitd0acd025ec47488d3b6d1f3f8c731ad9036d359e (patch)
tree6d27135d47af9acab2b0feac9034d230af43dbbe
parent2158a7002574728e27a9f12e35d78a0e8b8c65bd (diff)
downloadrails-d0acd025ec47488d3b6d1f3f8c731ad9036d359e.tar.gz
rails-d0acd025ec47488d3b6d1f3f8c731ad9036d359e.tar.bz2
rails-d0acd025ec47488d3b6d1f3f8c731ad9036d359e.zip
Test ActiveRecord::Base#[]= as well as #write_attribute
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index b6cf26f978..398aa8e28a 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -258,8 +258,14 @@ class AttributeMethodsTest < ActiveRecord::TestCase
topic.send(:write_attribute, :title, "Still another topic")
assert_equal "Still another topic", topic.title
- topic.send(:write_attribute, "title", "Still another topic: part 2")
+ topic[:title] = "Still another topic: part 2"
assert_equal "Still another topic: part 2", topic.title
+
+ topic.send(:write_attribute, "title", "Still another topic: part 3")
+ assert_equal "Still another topic: part 3", topic.title
+
+ topic["title"] = "Still another topic: part 4"
+ assert_equal "Still another topic: part 4", topic.title
end
def test_read_attribute