diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 12 | ||||
-rwxr-xr-x | actionpack/test/controller/redirect_test.rb | 10 |
2 files changed, 21 insertions, 1 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index e9c7ee67e1..77e9d5be26 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -135,6 +135,11 @@ class NewRenderTestController < ActionController::Base # Action template sets variable that's picked up by layout end + def render_text_with_assigns + @hello = "world" + render :text => "foo" + end + def rescue_action(e) raise end private @@ -342,4 +347,9 @@ class NewRenderTest < Test::Unit::TestCase get :partial_collection_with_locals assert_equal "Bonjour: davidBonjour: mary", @response.body end -end
\ No newline at end of file + + def test_render_text_with_assigns + get :render_text_with_assigns + assert_equal "world", assigns["hello"] + end +end diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb index 403bb8f9d5..f18f3682de 100755 --- a/actionpack/test/controller/redirect_test.rb +++ b/actionpack/test/controller/redirect_test.rb @@ -17,6 +17,11 @@ class RedirectController < ActionController::Base redirect_to :controller => 'module_test/module_redirect', :action => "hello_world" end + def redirect_with_assigns + @hello = "world" + redirect_to :action => "hello_world" + end + def rescue_errors(e) raise e end protected @@ -56,6 +61,11 @@ class RedirectTest < Test::Unit::TestCase get :module_redirect assert_redirected_to :controller => 'module_test/module_redirect', :action => 'hello_world' end + + def test_redirect_with_assigns + get :redirect_with_assigns + assert_equal "world", assigns["hello"] + end end module ModuleTest |