aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-04-25 03:54:46 +0000
committerRick Olson <technoweenie@gmail.com>2006-04-25 03:54:46 +0000
commit51cd1aec00c182c6789f09f9bf40365934034bcd (patch)
tree012105a1b37de543ed13b513285a006aa181112d /actionpack/test
parent71a570ffd7ecc94b5b474c659a34e36a29989a65 (diff)
downloadrails-51cd1aec00c182c6789f09f9bf40365934034bcd.tar.gz
rails-51cd1aec00c182c6789f09f9bf40365934034bcd.tar.bz2
rails-51cd1aec00c182c6789f09f9bf40365934034bcd.zip
Fix assert_redirected_to tests according to real-world usage.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4261 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/action_pack_assertions_test.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb
index aae690d266..f55fb6cbf8 100644
--- a/actionpack/test/controller/action_pack_assertions_test.rb
+++ b/actionpack/test/controller/action_pack_assertions_test.rb
@@ -234,7 +234,7 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase
process :redirect_to_named_route
assert_redirected_to 'http://test.host/route_one'
assert_redirected_to route_one_url
- assert_redirected_to :route_one
+ assert_redirected_to :route_one_url
end
end
@@ -256,7 +256,7 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase
assert_redirected_to route_two_url
end
assert_raise(Test::Unit::AssertionFailedError) do
- assert_redirected_to :route_two
+ assert_redirected_to :route_two_url
end
end
end
@@ -456,7 +456,7 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase
assert "Inconceivable!", @response.body
end
-
+
def test_follow_redirect_outside_current_action
process :redirect_to_controller
assert_redirected_to :controller => "elsewhere", :action => "flash_me"
@@ -464,6 +464,18 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase
assert_raises(RuntimeError, "Can't follow redirects outside of current controller (elsewhere)") { follow_redirect }
end
+ def test_assert_redirection_fails_with_incorrect_controller
+ process :redirect_to_controller
+ assert_raise(Test::Unit::AssertionFailedError) do
+ assert_redirected_to :controller => "action_pack_assertions", :action => "flash_me"
+ end
+ end
+
+ def test_assert_redirection_with_extra_controller_option
+ get :redirect_to_action
+ assert_redirected_to :controller => 'action_pack_assertions', :action => "flash_me", :id => 1, :params => { :panda => 'fun' }
+ end
+
def test_redirected_to_url_leadling_slash
process :redirect_to_path
assert_redirected_to '/some/path'