diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 9 | ||||
-rwxr-xr-x | actionpack/test/controller/redirect_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/render_test.rb | 9 |
3 files changed, 17 insertions, 3 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 8af594e94a..cd7a813df2 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -92,7 +92,7 @@ class NewRenderTestController < ActionController::Base end def accessing_params_in_template_with_layout - render :inline => "Hello: <%= params[:name] %>", :layout => nil + render :layout => nil, :inline => "Hello: <%= params[:name] %>" end def render_with_explicit_template @@ -201,15 +201,22 @@ class NewRenderTest < Test::Unit::TestCase end def test_access_to_request_in_view + view_internals_old_value = ActionController::Base.view_controller_internals + ActionController::Base.view_controller_internals = false + ActionController::Base.protected_variables_cache = nil get :hello_world assert_nil(assigns["request"]) ActionController::Base.view_controller_internals = true + ActionController::Base.protected_variables_cache = nil get :hello_world assert_kind_of ActionController::AbstractRequest, assigns["request"] + + ActionController::Base.view_controller_internals = view_internals_old_value + ActionController::Base.protected_variables_cache = nil end def test_render_xml diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb index 36e742453a..403bb8f9d5 100755 --- a/actionpack/test/controller/redirect_test.rb +++ b/actionpack/test/controller/redirect_test.rb @@ -97,4 +97,4 @@ module ModuleTest assert_redirected_to :controller => 'redirect', :action => "hello_world" end end -end
\ No newline at end of file +end diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 82ed4d755f..0a86cc914e 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -140,17 +140,24 @@ class RenderTest < Test::Unit::TestCase end def test_access_to_request_in_view + view_internals_old_value = ActionController::Base.view_controller_internals + ActionController::Base.view_controller_internals = false + ActionController::Base.protected_variables_cache = nil @request.action = "hello_world" response = process_request assert_nil response.template.assigns["request"] ActionController::Base.view_controller_internals = true + ActionController::Base.protected_variables_cache = nil @request.action = "hello_world" response = process_request - assert_kind_of ActionController::AbstractRequest, response.template.assigns["request"] + assert_kind_of ActionController::AbstractRequest, response.template.assigns["request"] + + ActionController::Base.view_controller_internals = view_internals_old_value + ActionController::Base.protected_variables_cache = nil end def test_render_xml |