From 2038c2c53dafcebef32b4f1e31a97368b1b267e4 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Tue, 16 Dec 2014 17:33:53 +0100 Subject: Test to ensure content_tag works when fixing #17661 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After c2fe093, which was reverted yesterday, there will likely be future PRs to address #17661. The test `actionview/test/template/capture_helper_test.rb #test_capture_returns_nil_if_the_returned_value_is_not_a_string` should have errored with c2fe093, but it was rewritten in the PR to not raise. My guess is that it may have seemed irrelevant to the content_tag tests or already covered by them. This test provides additional protection by being in the content_tag test suite to explicitly raise a red flag in future cases. It foregoes some redundancy for safety — at least until #17661 is closed. --- actionview/test/template/tag_helper_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/actionview/test/template/tag_helper_test.rb b/actionview/test/template/tag_helper_test.rb index 7fc798dec9..d037447567 100644 --- a/actionview/test/template/tag_helper_test.rb +++ b/actionview/test/template/tag_helper_test.rb @@ -50,6 +50,11 @@ class TagHelperTest < ActionView::TestCase assert_dom_equal "
Hello world!
", buffer end + def test_content_tag_with_block_in_erb_containing_non_displayed_erb + buffer = render_erb("<%= content_tag(:p) do %><% 1 %><% end %>") + assert_dom_equal "

", buffer + end + def test_content_tag_with_block_and_options_in_erb buffer = render_erb("<%= content_tag(:div, :class => 'green') do %>Hello world!<% end %>") assert_dom_equal %(
Hello world!
), buffer -- cgit v1.2.3