提交 dd54b518 编写于 作者: Y Yves Senn

Merge pull request #18358 from prathamesh-sonpatki/add-test-for-non-string-labeled-fixtures

Fix lookup of fixtures with non-string(like Fixnum) label
* Fix accessing of fixtures having non-string labels like Fixnum.
*Prathamesh Sonpatki*
* Remove deprecated support to preload instance-dependent associations.
*Yves Senn*
......
......@@ -882,7 +882,7 @@ def setup_fixture_accessors(fixture_set_names = nil)
@fixture_cache[fs_name] ||= {}
instances = fixture_names.map do |f_name|
f_name = f_name.to_s
f_name = f_name.to_s if f_name.is_a?(Symbol)
@fixture_cache[fs_name].delete(f_name) if force_reload
if @loaded_fixtures[fs_name][f_name]
......
......@@ -792,6 +792,10 @@ def test_supports_label_string_interpolation
assert_equal("X marks the spot!", pirates(:mark).catchphrase)
end
def test_supports_label_interpolation_for_fixnum_label
assert_equal("#1 pirate!", pirates(1).catchphrase)
end
def test_supports_polymorphic_belongs_to
assert_equal(pirates(:redbeard), treasures(:sapphire).looter)
assert_equal(parrots(:louis), treasures(:ruby).looter)
......
......@@ -10,3 +10,6 @@ redbeard:
mark:
catchphrase: "X $LABELs the spot!"
1:
catchphrase: "#$LABEL pirate!"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册