提交 6b0b95f1 编写于 作者: E Emilio Tagua

Add test for update_attributes and identity map.

上级 f3adddb9
......@@ -274,4 +274,17 @@ def test_reload_object_if_forced_save_failed
assert_not_equal developer.salary, same_developer.salary
end
def test_reload_object_if_update_attributes_fails
developer = Developer.first
developer.salary = 0
assert !developer.update_attributes(:salary => 0)
same_developer = Developer.first
assert_not_same developer, same_developer
assert_not_equal 0, same_developer.salary
assert_not_equal developer.salary, same_developer.salary
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册