diff options
author | Jamis Buck <jamis@37signals.com> | 2005-07-31 12:16:21 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-07-31 12:16:21 +0000 |
commit | 08ebab5d20527d6dd6600445fc5ec280d502596f (patch) | |
tree | 3ba3b69baf8333dac30eb30e6cbf08e76dd130f0 /actionpack/test/controller | |
parent | 020ed6fa1fa5f73e5af88e3c9cdff09293e76789 (diff) | |
download | rails-08ebab5d20527d6dd6600445fc5ec280d502596f.tar.gz rails-08ebab5d20527d6dd6600445fc5ec280d502596f.tar.bz2 rails-08ebab5d20527d6dd6600445fc5ec280d502596f.zip |
Make sure assigns are built for every request when testing #1866
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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 |