提交 77e0b798 编写于 作者: J Jeremy Kemper

Use query methods rather than readers in boolean tests for [3092]. References...

Use query methods rather than readers in boolean tests for [3092].  References #2945.  Closes #2949.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3094 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 2ed6d365
......@@ -226,19 +226,19 @@ def test_read_write_boolean_attribute
topic.approved = "false"
# puts "Expecting false"
# puts topic.inspect
assert !topic.approved, "approved should be false"
assert !topic.approved?, "approved should be false"
topic.approved = "false"
# puts "Expecting false"
# puts topic.inspect
assert !topic.approved, "approved should be false"
assert !topic.approved?, "approved should be false"
topic.approved = "true"
# puts "Expecting true"
# puts topic.inspect
assert topic.approved, "approved should be true"
assert topic.approved?, "approved should be true"
topic.approved = "true"
# puts "Expecting true"
# puts topic.inspect
assert topic.approved, "approved should be true"
assert topic.approved?, "approved should be true"
# puts ""
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册