From 49306ccacf01e36d444771d42321965616e226f0 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 11 Dec 2008 11:06:35 -0600 Subject: Add :partial option to assert_template [#1550 state:resolved] Signed-off-by: Joshua Peek --- actionpack/test/controller/action_pack_assertions_test.rb | 6 +++--- actionpack/test/controller/render_test.rb | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index ea56048f37..87c12ee4ee 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -326,11 +326,11 @@ class ActionPackAssertionsControllerTest < ActionController::TestCase # check if we were rendered by a file-based template? def test_rendered_action process :nothing - assert_nil @response.rendered_template + assert_nil @response.rendered[:template] process :hello_world - assert @response.rendered_template - assert 'hello_world', @response.rendered_template.to_s + assert @response.rendered[:template] + assert 'hello_world', @response.rendered[:template].to_s end # check the redirection location diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index c5496a9af5..87733c2d33 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -1310,21 +1310,28 @@ class RenderTest < ActionController::TestCase def test_partial_collection_with_spacer get :partial_collection_with_spacer assert_equal "Hello: davidonly partialHello: mary", @response.body + assert_template :partial => 'test/_partial_only' + assert_template :partial => '_customer' end def test_partial_collection_shorthand_with_locals get :partial_collection_shorthand_with_locals assert_equal "Bonjour: davidBonjour: mary", @response.body + assert_template :partial => 'customers/_customer', :count => 2 + assert_template :partial => '_completely_fake_and_made_up_template_that_cannot_possibly_be_rendered', :count => 0 end def test_partial_collection_shorthand_with_different_types_of_records get :partial_collection_shorthand_with_different_types_of_records assert_equal "Bonjour bad customer: mark0Bonjour good customer: craig1Bonjour bad customer: john2Bonjour good customer: zach3Bonjour good customer: brandon4Bonjour bad customer: dan5", @response.body + assert_template :partial => 'good_customers/_good_customer', :count => 3 + assert_template :partial => 'bad_customers/_bad_customer', :count => 3 end def test_empty_partial_collection get :empty_partial_collection assert_equal " ", @response.body + assert_template :partial => false end def test_partial_with_hash_object -- cgit v1.2.3