提交 be8d1a9b 编写于 作者: Z Zachary Scott

Add a test for reflection keys as Strings, fixes #16928

See also PR: #17610
上级 c837259a
......@@ -209,6 +209,10 @@ def test_reflection_should_not_raise_error_when_compared_to_other_object
assert_not_equal Object.new, Firm._reflections['clients']
end
def test_reflections_should_return_keys_as_strings
assert Category.reflections.keys.all? { |key| key.is_a? String }, "Model.reflections is expected to return string for keys"
end
def test_has_and_belongs_to_many_reflection
assert_equal :has_and_belongs_to_many, Category.reflections['posts'].macro
assert_equal :posts, Category.reflect_on_all_associations(:has_and_belongs_to_many).first.name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册