diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 14:12:23 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-01-02 14:12:23 -0300 |
commit | 873870df4cbb0b79d1cb6d811cf68d3aa9fdc625 (patch) | |
tree | 69ae79f4064b6d5af931b03585540ef4d06a33b5 /actionview/test | |
parent | c455817804e4df64c46c17a0cdec0e5a1ca5ba2e (diff) | |
parent | f02a35b86efea24f1e2ab684bc8081ced5eb3b1a (diff) | |
download | rails-873870df4cbb0b79d1cb6d811cf68d3aa9fdc625.tar.gz rails-873870df4cbb0b79d1cb6d811cf68d3aa9fdc625.tar.bz2 rails-873870df4cbb0b79d1cb6d811cf68d3aa9fdc625.zip |
Merge pull request #17974 from killthekitten/fix-render-block
Make possible to use blocks with short version of render partial
Conflicts:
actionview/CHANGELOG.md
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/fixtures/test/_partial_shortcut_with_block_content.html.erb | 3 | ||||
-rw-r--r-- | actionview/test/template/render_test.rb | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/actionview/test/fixtures/test/_partial_shortcut_with_block_content.html.erb b/actionview/test/fixtures/test/_partial_shortcut_with_block_content.html.erb new file mode 100644 index 0000000000..352128f3ba --- /dev/null +++ b/actionview/test/fixtures/test/_partial_shortcut_with_block_content.html.erb @@ -0,0 +1,3 @@ +<%= render "test/layout_for_block_with_args" do |arg_1, arg_2| %> + Yielded: <%= arg_1 %>/<%= arg_2 %> +<% end %> diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index e580a477a6..dc4abca048 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -480,6 +480,11 @@ module RenderTestCases @view.render(:partial => 'test/partial_with_partial', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) end + def test_render_partial_shortcut_with_block_content + assert_equal %(Before (shortcut test)\nBefore\n\n Yielded: arg1/arg2\n\nAfter\nAfter), + @view.render(partial: "test/partial_shortcut_with_block_content", layout: "test/layout_for_partial", locals: { name: "shortcut test" }) + end + def test_render_layout_with_a_nested_render_layout_call assert_equal %(Before (Foo!)\nBefore (Bar!)\npartial html\nAfter\npartial with layout\n\nAfter), @view.render(:partial => 'test/partial_with_layout', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) |