aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorMike Breen <hardbap@gmail.com>2009-05-17 19:48:15 +0200
committerPratik Naik <pratiknaik@gmail.com>2009-05-17 19:50:00 +0200
commitedc9c226d11e6104d191ceeb6416c7062ceda54a (patch)
treebfe1c27330b01fbee43baf802aed4b39444940da /actionpack/test
parent8118fca9beec675fba19395e7d1027eaa4b5703a (diff)
downloadrails-edc9c226d11e6104d191ceeb6416c7062ceda54a.tar.gz
rails-edc9c226d11e6104d191ceeb6416c7062ceda54a.tar.bz2
rails-edc9c226d11e6104d191ceeb6416c7062ceda54a.zip
Add tests for assert_template :template
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/action_pack_assertions_test.rb23
1 files changed, 23 insertions, 0 deletions
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