aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/test_case_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template/test_case_test.rb')
-rw-r--r--actionpack/test/template/test_case_test.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/actionpack/test/template/test_case_test.rb b/actionpack/test/template/test_case_test.rb
index c365aec841..d86dc7b185 100644
--- a/actionpack/test/template/test_case_test.rb
+++ b/actionpack/test/template/test_case_test.rb
@@ -220,10 +220,24 @@ module ActionView
end
class RenderTemplateTest < ActionView::TestCase
- test "render template" do
+ test "render template supports specifying partials" do
controller.controller_path = "test"
render(:template => "test/calling_partial_with_layout")
- assert_template "partial_for_use_in_layout"
+ assert_template :partial => "_partial_for_use_in_layout"
+ end
+
+ test "render template supports specifying locals (passing)" do
+ controller.controller_path = "test"
+ render(:template => "test/calling_partial_with_layout")
+ assert_template :partial => "_partial_for_use_in_layout", :locals => { :name => "David" }
+ end
+
+ test "render template supports specifying locals (failing)" do
+ controller.controller_path = "test"
+ render(:template => "test/calling_partial_with_layout")
+ assert_raise Test::Unit::AssertionFailedError, /Somebody else.*David/m do
+ assert_template :partial => "_partial_for_use_in_layout", :locals => { :name => "Somebody Else" }
+ end
end
end
end