diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-11-08 16:03:15 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-11-08 16:03:15 -0600 |
commit | c10f4ae01d91d1afc90b21d4bba51e59ae9a0625 (patch) | |
tree | 67c0428c4a31452227bca75ba835a642bd01fd41 /actionpack | |
parent | a595abff211eee97d75c51c085cfdc821b1edb46 (diff) | |
parent | f125a34501e21b1e0da2b80d149df7a739482804 (diff) | |
download | rails-c10f4ae01d91d1afc90b21d4bba51e59ae9a0625.tar.gz rails-c10f4ae01d91d1afc90b21d4bba51e59ae9a0625.tar.bz2 rails-c10f4ae01d91d1afc90b21d4bba51e59ae9a0625.zip |
Merge remote branch 'Fingertips/master'
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 1 | ||||
-rw-r--r-- | actionpack/test/template/test_case_test.rb | 13 |
2 files changed, 10 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 8beda24aba..86bbad822d 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -120,6 +120,7 @@ module ActionView def _view view = ActionView::Base.new(ActionController::Base.view_paths, _assigns, @controller) view.class.send :include, _helpers + view.output_buffer = self.output_buffer view end diff --git a/actionpack/test/template/test_case_test.rb b/actionpack/test/template/test_case_test.rb index ca72c13ffa..05a409d05a 100644 --- a/actionpack/test/template/test_case_test.rb +++ b/actionpack/test/template/test_case_test.rb @@ -24,7 +24,7 @@ module ActionView test_case.class_eval do test "helpers defined on ActionView::TestCase are available" do assert test_case.ancestors.include?(ASharedTestHelper) - assert 'Holla!', from_shared_helper + assert_equal 'Holla!', from_shared_helper end end end @@ -38,10 +38,15 @@ module ActionView assert_equal 'Eloy', render('developers/developer', :developer => stub(:name => 'Eloy')) end + test "can render a layout with block" do + assert_equal "Before (ChrisCruft)\n!\nAfter", + render(:layout => "test/layout_for_partial", :locals => {:name => "ChrisCruft"}) {"!"} + end + helper AnotherTestHelper test "additional helper classes can be specified as in a controller" do assert test_case.ancestors.include?(AnotherTestHelper) - assert 'Howdy!', from_another_helper + assert_equal 'Howdy!', from_another_helper end end @@ -58,14 +63,14 @@ module ActionView helper AnotherTestHelper test "additional helper classes can be specified as in a controller" do assert test_case.ancestors.include?(AnotherTestHelper) - assert 'Howdy!', from_another_helper + assert_equal 'Howdy!', from_another_helper test_case.helper_class.module_eval do def render_from_helper from_another_helper end end - assert 'Howdy!', render(:partial => 'test/from_helper') + assert_equal 'Howdy!', render(:partial => 'test/from_helper') end end |