diff options
-rw-r--r-- | actionpack/test/template/render_test.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 5637f3f42e..0ef3239f83 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -34,14 +34,14 @@ module RenderTestCases # Test if :formats, :locale etc. options are passed correctly to the resolvers. def test_render_file_with_format - assert_equal "<h1>No Comment</h1>", @view.render(:file => "comments/empty", :formats => [:html]) - assert_equal "<error>No Comment</error>", @view.render(:file => "comments/empty", :formats => [:xml]) - assert_equal "<error>No Comment</error>", @view.render(:file => "comments/empty", :formats => :xml) + assert_match "<h1>No Comment</h1>", @view.render(:file => "comments/empty", :formats => [:html]) + assert_match "<error>No Comment</error>", @view.render(:file => "comments/empty", :formats => [:xml]) + assert_match "<error>No Comment</error>", @view.render(:file => "comments/empty", :formats => :xml) end def test_render_template_with_format - assert_equal "<h1>No Comment</h1>", @view.render(:template => "comments/empty", :formats => [:html]) - assert_equal "<error>No Comment</error>", @view.render(:template => "comments/empty", :formats => [:xml]) + assert_match "<h1>No Comment</h1>", @view.render(:template => "comments/empty", :formats => [:html]) + assert_match "<error>No Comment</error>", @view.render(:template => "comments/empty", :formats => [:xml]) end def test_render_file_with_locale @@ -110,6 +110,11 @@ module RenderTestCases assert_equal 'partial html', @view.render(:partial => 'test/partial') end + def test_render_partial_with_selected_format + assert_equal 'partial html', @view.render(:partial => 'test/partial', :formats => :html) + assert_equal 'partial js', @view.render(:partial => 'test/partial', :formats => [:js]) + end + def test_render_partial_at_top_level # file fixtures/_top_level_partial_only (not fixtures/test) assert_equal 'top level partial', @view.render(:partial => '/top_level_partial_only') |