Skip to content
Browse files

Add tests for assert_template :template

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information...
1 parent 8118fca commit edc9c226d11e6104d191ceeb6416c7062ceda54a @hardbap hardbap committed with lifo May 17, 2009
Showing with 23 additions and 0 deletions.
  1. +23 −0 actionpack/test/controller/action_pack_assertions_test.rb
View
23 actionpack/test/controller/action_pack_assertions_test.rb
@@ -12,6 +12,9 @@ def hello_world() render :template => "test/hello_world"; end
# 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 @@ def test_flash_have_nots
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

0 comments on commit edc9c22

Please sign in to comment.
Something went wrong with that request. Please try again.