aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/test_test.rb
diff options
context:
space:
mode:
authorAndreas Neuhaus <zargony@zargony.com>2008-05-10 17:54:09 +0200
committerMichael Koziarski <michael@koziarski.com>2008-05-11 18:30:10 +1200
commit74eed6290e63111d1aad2b181692a84f4f040aea (patch)
treec135f4062dce31d8dabf39753f1a1256f4776d16 /actionpack/test/controller/test_test.rb
parenta7ea06b4ebe252e258f83e7de945b4baa30ec3bc (diff)
downloadrails-74eed6290e63111d1aad2b181692a84f4f040aea.tar.gz
rails-74eed6290e63111d1aad2b181692a84f4f040aea.tar.bz2
rails-74eed6290e63111d1aad2b181692a84f4f040aea.zip
Fixed flash.now not being accessible in tests. Flash sweeping is now done before action processing instead after
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#10 state:resolved]
Diffstat (limited to 'actionpack/test/controller/test_test.rb')
-rw-r--r--actionpack/test/controller/test_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb
index 04cc2a20d8..ba6c7f4299 100644
--- a/actionpack/test/controller/test_test.rb
+++ b/actionpack/test/controller/test_test.rb
@@ -12,6 +12,11 @@ class TestTest < Test::Unit::TestCase
render :text => 'ignore me'
end
+ def set_flash_now
+ flash.now["test_now"] = ">#{flash["test_now"]}<"
+ render :text => 'ignore me'
+ end
+
def set_session
session['string'] = 'A wonder'
session[:symbol] = 'it works'
@@ -145,6 +150,11 @@ XML
assert_equal '>value<', flash['test']
end
+ def test_process_with_flash_now
+ process :set_flash_now, nil, nil, { "test_now" => "value_now" }
+ assert_equal '>value_now<', flash['test_now']
+ end
+
def test_process_with_session
process :set_session
assert_equal 'A wonder', session['string'], "A value stored in the session should be available by string key"