From bc81ba2451a6a6c5507ad497cf838935e9d1ece2 Mon Sep 17 00:00:00 2001 From: lest Date: Sun, 27 Nov 2011 16:59:44 +0300 Subject: fix label with block in erb --- actionpack/test/fixtures/test/_label_with_block.erb | 4 ++++ actionpack/test/template/form_helper_test.rb | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 actionpack/test/fixtures/test/_label_with_block.erb (limited to 'actionpack/test') diff --git a/actionpack/test/fixtures/test/_label_with_block.erb b/actionpack/test/fixtures/test/_label_with_block.erb new file mode 100644 index 0000000000..40117e594e --- /dev/null +++ b/actionpack/test/fixtures/test/_label_with_block.erb @@ -0,0 +1,4 @@ +<%= label 'post', 'message' do %> + Message + <%= text_field 'post', 'message' %> +<% end %> diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index ccedcd7dac..0758106a40 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -230,6 +230,13 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal('', label(:post, :title) { "The title, please:" }) end + def test_label_with_block_in_erb + path = ActionView::FileSystemResolver.new(FIXTURE_LOAD_PATH) + view_paths = ActionView::PathSet.new([path]) + view = ActionView::Base.new(view_paths) + assert_equal "", view.render("test/label_with_block") + end + def test_text_field assert_dom_equal( '', text_field("post", "title") -- cgit v1.2.3