diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-12 19:35:30 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-12 19:35:30 +0000 |
commit | 61a6a440cb8bc4694828c437fb1996db270c9ee6 (patch) | |
tree | 9ea9e831e453537f9d5ca923ac5543dc25978b68 /actionpack/lib | |
parent | 2c110b825e743f62c84a0c3e247ad524a9ac81c6 (diff) | |
download | rails-61a6a440cb8bc4694828c437fb1996db270c9ee6.tar.gz rails-61a6a440cb8bc4694828c437fb1996db270c9ee6.tar.bz2 rails-61a6a440cb8bc4694828c437fb1996db270c9ee6.zip |
Added follow_redirect method for functional tests that'll get-request the redirect that was made.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@585 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index 1fe38136fe..7458230d78 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -251,6 +251,14 @@ module Test end EOV end + + def follow_redirect + if @response.redirected_to[:controller] + raise "Can't follow redirects outside of current controller (#{@response.redirected_to[:controller]})" + end + + get(@response.redirected_to.delete(:action), @response.redirected_to) + end end end -end +end
\ No newline at end of file |