Browse files

Deprecate the limited follow_redirect in functional tests. If you wis…

…h to follow redirects, use integration tests.
  • Loading branch information...
1 parent ef0bd72 commit c6a4c1735a9491dd36dd2e5435b0a58cdfd9db7b @NZKoz NZKoz committed Jun 23, 2008
View
2 actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*2.1.1 (next release)*
+* Deprecate the limited follow_redirect in functional tests. If you wish to follow redirects, use integration tests. [Michael Koziarski]
+
* Deprecate define_javascript_functions, javascript_include_tag and friends are much better [Michael Koziarski]
* Fix polymorphic_url with singleton resources. #461 [Tammer Saleh]
View
2 actionpack/lib/action_controller/test_process.rb
@@ -413,6 +413,8 @@ def follow_redirect
get(@response.redirected_to.delete(:action), @response.redirected_to.stringify_keys)
end
+ deprecate :follow_redirect => "If you wish to follow redirects, you should use integration tests"
+
def assigns(key = nil)
if key.nil?
@response.template.assigns
View
6 actionpack/test/controller/action_pack_assertions_test.rb
@@ -423,7 +423,7 @@ def test_follow_redirect
process :redirect_to_action
assert_redirected_to :action => "flash_me"
- follow_redirect
+ assert_deprecated { follow_redirect }
assert_equal 1, @request.parameters["id"].to_i
assert "Inconceivable!", @response.body
@@ -433,7 +433,9 @@ def test_follow_redirect_outside_current_action
process :redirect_to_controller
assert_redirected_to :controller => "elsewhere", :action => "flash_me"
- assert_raises(RuntimeError, "Can't follow redirects outside of current controller (elsewhere)") { follow_redirect }
+ assert_raises(RuntimeError, "Can't follow redirects outside of current controller (elsewhere)") do
+ assert_deprecated { follow_redirect }
+ end
end
def test_assert_redirection_fails_with_incorrect_controller
View
8 actionpack/test/controller/test_test.rb
@@ -571,7 +571,9 @@ def test_assert_follow_redirect_to_same_controller
get :redirect_to_same_controller
assert_response :redirect
assert_redirected_to :controller => 'test_test/test', :action => 'test_uri', :id => 5
- assert_nothing_raised { follow_redirect }
+ assert_deprecated 'follow_redirect' do
+ assert_nothing_raised { follow_redirect }
+ end
end
end
@@ -580,7 +582,9 @@ def test_assert_follow_redirect_to_different_controller
get :redirect_to_different_controller
assert_response :redirect
assert_redirected_to :controller => 'fail', :id => 5
- assert_raise(RuntimeError) { follow_redirect }
+ assert_raise(RuntimeError) do
+ assert_deprecated { follow_redirect }
+ end
end
end

0 comments on commit c6a4c17

Please sign in to comment.