Skip to content
Browse files

Test ActiveRecord::Base#[]= as well as #write_attribute

  • Loading branch information...
1 parent 2158a70 commit d0acd025ec47488d3b6d1f3f8c731ad9036d359e @tomstuart committed Jan 11, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 activerecord/test/cases/attribute_methods_test.rb
View
8 activerecord/test/cases/attribute_methods_test.rb
@@ -258,8 +258,14 @@ def test_write_attribute
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

0 comments on commit d0acd02

Please sign in to comment.
Something went wrong with that request. Please try again.