提交 d0acd025 编写于 作者: T Tom Stuart

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

上级 2158a700
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册