diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-01-31 18:18:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-31 18:18:31 -0500 |
commit | 087385a0946645744b7702b3e5af71a04c84e086 (patch) | |
tree | a41fc0dab3cd937d38ffc18675beee577cc365cf /actionview/test | |
parent | 773e45a59163415e8bc247ebee1663c7e8113c81 (diff) | |
parent | 4cf981f84637022bcf225afd3f13e088d3b0d154 (diff) | |
download | rails-087385a0946645744b7702b3e5af71a04c84e086.tar.gz rails-087385a0946645744b7702b3e5af71a04c84e086.tar.bz2 rails-087385a0946645744b7702b3e5af71a04c84e086.zip |
Merge pull request #27795 from meagar/fix-missing-partial-iteration
Fix missing partial iteration
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/fixtures/test/_partial_iteration_1.erb | 1 | ||||
-rw-r--r-- | actionview/test/fixtures/test/_partial_iteration_2.erb | 1 | ||||
-rw-r--r-- | actionview/test/template/render_test.rb | 9 |
3 files changed, 11 insertions, 0 deletions
diff --git a/actionview/test/fixtures/test/_partial_iteration_1.erb b/actionview/test/fixtures/test/_partial_iteration_1.erb new file mode 100644 index 0000000000..c0fdd4c22a --- /dev/null +++ b/actionview/test/fixtures/test/_partial_iteration_1.erb @@ -0,0 +1 @@ +<%= defined?(partial_iteration_1_iteration) %> diff --git a/actionview/test/fixtures/test/_partial_iteration_2.erb b/actionview/test/fixtures/test/_partial_iteration_2.erb new file mode 100644 index 0000000000..50dd11db27 --- /dev/null +++ b/actionview/test/fixtures/test/_partial_iteration_2.erb @@ -0,0 +1 @@ +<%= defined?(partial_iteration_2_iteration) -%> diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index 7c5a53b98b..960b7a9d52 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -301,6 +301,15 @@ module RenderTestCases @view.render(partial: "test/local_inspector", collection: [ Customer.new("mary") ]) end + def test_render_partial_collection_with_different_partials_still_provides_partial_iteration + a = {} + b = {} + def a.to_partial_path; "test/partial_iteration_1"; end + def b.to_partial_path; "test/partial_iteration_2"; end + + assert_equal "local-variable\nlocal-variable", @controller_view.render([a, b]) + end + def test_render_partial_with_empty_collection_should_return_nil assert_nil @view.render(partial: "test/customer", collection: []) end |