From edc9c226d11e6104d191ceeb6416c7062ceda54a Mon Sep 17 00:00:00 2001 From: Mike Breen Date: Sun, 17 May 2009 19:48:15 +0200 Subject: Add tests for assert_template :template Signed-off-by: Pratik Naik --- .../test/controller/action_pack_assertions_test.rb | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (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 484d3c5ce7..c3c769919a 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -12,6 +12,9 @@ class ActionPackAssertionsController < ActionController::Base # a standard template def hello_xml_world() render :template => "test/hello_xml_world"; end + # a standard partial + def partial() render :partial => 'test/partial'; end + # a redirect to an internal location def redirect_internal() redirect_to "/nothing"; end @@ -331,6 +334,26 @@ class ActionPackAssertionsControllerTest < ActionController::TestCase end end + def test_assert_template_with_partial + get :partial + assert_template :partial => '_partial' + end + + def test_assert_template_with_nil + get :nothing + assert_template nil + end + + def test_assert_template_with_string + get :hello_world + assert_template 'hello_world' + end + + def test_assert_template_with_symbol + get :hello_world + assert_template :hello_world + end + # check if we were rendered by a file-based template? def test_rendered_action process :nothing -- cgit v1.2.3