提交 1e122ff7 编写于 作者: Y Yves Senn

Merge pull request #15850 from sgrif/sg-missing-tests

Add missing test cases for `attribute_method?`
......@@ -831,6 +831,17 @@ def some_method_that_is_not_on_super
end
end
def test_attribute_method?
assert @target.attribute_method?(:title)
assert @target.attribute_method?(:title=)
assert_not @target.attribute_method?(:wibble)
end
def test_attribute_method_returns_false_if_table_does_not_exist
@target.table_name = 'wibble'
assert_not @target.attribute_method?(:title)
end
private
def new_topic_like_ar_class(&block)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册