diff options
author | Pablo Olmos de Aguilera Corradini <pablo@glatelier.org> | 2015-01-02 21:36:35 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 23:01:24 -0300 |
commit | 9405ecdd98af9c8f0bd19c58a19798ebe364ed62 (patch) | |
tree | 48a27719163f6e61cad0dbc34b572d781b4769d4 /railties/test/generators | |
parent | 3456d543eba1f29e97c6c924302ea6898d9ab1d8 (diff) | |
download | rails-9405ecdd98af9c8f0bd19c58a19798ebe364ed62.tar.gz rails-9405ecdd98af9c8f0bd19c58a19798ebe364ed62.tar.bz2 rails-9405ecdd98af9c8f0bd19c58a19798ebe364ed62.zip |
Generated fixtures won't use parent_id when generated with parent:references
Fix #18301
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/model_generator_test.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/test/generators/model_generator_test.rb b/railties/test/generators/model_generator_test.rb index 9dc438fe3c..afee0a655d 100644 --- a/railties/test/generators/model_generator_test.rb +++ b/railties/test/generators/model_generator_test.rb @@ -287,18 +287,18 @@ class ModelGeneratorTest < Rails::Generators::TestCase def test_fixtures_use_the_references_ids run_generator ["LineItem", "product:references", "cart:belongs_to"] - assert_file "test/fixtures/line_items.yml", /product_id: \n cart_id: / + assert_file "test/fixtures/line_items.yml", /product: \n cart: / assert_generated_fixture("test/fixtures/line_items.yml", - {"one"=>{"product_id"=>nil, "cart_id"=>nil}, "two"=>{"product_id"=>nil, "cart_id"=>nil}}) + {"one"=>{"product"=>nil, "cart"=>nil}, "two"=>{"product"=>nil, "cart"=>nil}}) end def test_fixtures_use_the_references_ids_and_type run_generator ["LineItem", "product:references{polymorphic}", "cart:belongs_to"] - assert_file "test/fixtures/line_items.yml", /product_id: \n product_type: Product\n cart_id: / + assert_file "test/fixtures/line_items.yml", /product: \n product_type: Product\n cart: / assert_generated_fixture("test/fixtures/line_items.yml", - {"one"=>{"product_id"=>nil, "product_type"=>"Product", "cart_id"=>nil}, - "two"=>{"product_id"=>nil, "product_type"=>"Product", "cart_id"=>nil}}) + {"one"=>{"product"=>nil, "product_type"=>"Product", "cart"=>nil}, + "two"=>{"product"=>nil, "product_type"=>"Product", "cart"=>nil}}) end def test_fixtures_respect_reserved_yml_keywords |