Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit f22c36bc826827f937dc0b964a085f763f4f4d9e 1 parent efa215a
Tom Stuart tomstuart authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 activerecord/test/cases/attribute_methods_test.rb
8 activerecord/test/cases/attribute_methods_test.rb
View
@@ -234,8 +234,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
Please sign in to comment.
Something went wrong with that request. Please try again.