diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 23:01:30 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 23:02:53 -0300 |
commit | a699f5d3e18e87e802bc460b6e4d2b6fd4921884 (patch) | |
tree | 02decbc9043b60b07307e18f12da6e97b05e4a09 /railties/test/generators/model_generator_test.rb | |
parent | 3456d543eba1f29e97c6c924302ea6898d9ab1d8 (diff) | |
parent | 9405ecdd98af9c8f0bd19c58a19798ebe364ed62 (diff) | |
download | rails-a699f5d3e18e87e802bc460b6e4d2b6fd4921884.tar.gz rails-a699f5d3e18e87e802bc460b6e4d2b6fd4921884.tar.bz2 rails-a699f5d3e18e87e802bc460b6e4d2b6fd4921884.zip |
Merge pull request #18309 from PaBLoX-CL/fix-fixtures-references
Generated fixtures won't use parent_id when generated with
parent:references
Diffstat (limited to 'railties/test/generators/model_generator_test.rb')
-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 |