aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-03-20 18:16:48 +0000
committerJamis Buck <jamis@37signals.com>2006-03-20 18:16:48 +0000
commitb0189f3f2ffd9de95ba2332cdcfaf48d28081e18 (patch)
treee2983d4778346001f262b19fe2932ed1fce2bf5e /actionpack/test
parent49414750693a61ad078549b9edb5260f32f69561 (diff)
downloadrails-b0189f3f2ffd9de95ba2332cdcfaf48d28081e18.tar.gz
rails-b0189f3f2ffd9de95ba2332cdcfaf48d28081e18.tar.bz2
rails-b0189f3f2ffd9de95ba2332cdcfaf48d28081e18.zip
Fix assert_redirected_to so it works with symbols
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4004 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/test_test.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb
index 06a2ce3eb7..88e0c159a7 100644
--- a/actionpack/test/controller/test_test.rb
+++ b/actionpack/test/controller/test_test.rb
@@ -7,7 +7,7 @@ class TestTest < Test::Unit::TestCase
flash["test"] = ">#{flash["test"]}<"
render :text => 'ignore me'
end
-
+
def render_raw_post
raise Test::Unit::AssertionFailedError, "#raw_post is blank" if request.raw_post.blank?
render :text => request.raw_post
@@ -54,9 +54,19 @@ HTML
render :text => params[:file].size
end
- def rescue_action(e)
- raise e
+ def redirect_to_symbol
+ redirect_to :generate_url, :id => 5
end
+
+ private
+
+ def rescue_action(e)
+ raise e
+ end
+
+ def generate_url(opts)
+ url_for(opts.merge(:action => "test_uri"))
+ end
end
def setup
@@ -393,4 +403,9 @@ HTML
def test_test_uploaded_file_exception_when_file_doesnt_exist
assert_raise(RuntimeError) { ActionController::TestUploadedFile.new('non_existent_file') }
end
+
+ def test_assert_redirected_to_symbol
+ get :redirect_to_symbol
+ assert_redirected_to :generate_url
+ end
end