diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-04-26 11:16:14 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-04-26 11:16:14 -0500 |
commit | 5ea8d401569323a10592d68d29b293c1ae131a8b (patch) | |
tree | 7acb2244c4061e03db5c64c05377be8067350bed | |
parent | 5352a2417b9f6297d16a6baefd1994be4d1e4a12 (diff) | |
download | rails-5ea8d401569323a10592d68d29b293c1ae131a8b.tar.gz rails-5ea8d401569323a10592d68d29b293c1ae131a8b.tar.bz2 rails-5ea8d401569323a10592d68d29b293c1ae131a8b.zip |
Deprecate response.redirect_url_match?, use assert_match instead.
-rw-r--r-- | actionpack/lib/action_controller/testing/process.rb | 1 | ||||
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/testing/process.rb b/actionpack/lib/action_controller/testing/process.rb index 05b756fa4d..2ad0579a30 100644 --- a/actionpack/lib/action_controller/testing/process.rb +++ b/actionpack/lib/action_controller/testing/process.rb @@ -157,6 +157,7 @@ module ActionController #:nodoc: # to the "real" CgiResponse class in integration tests. module TestResponseBehavior #:nodoc: def redirect_url_match?(pattern) + ::ActiveSupport::Deprecation.warn("response.redirect_url_match? is deprecated. Use assert_match(/foo/, response.redirect_url) instead", caller) return false if redirect_url.nil? p = Regexp.new(pattern) if pattern.class == String p = pattern if pattern.class == Regexp diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 96f7a42c9b..f091f9b87c 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -378,10 +378,12 @@ class ActionPackAssertionsControllerTest < ActionController::TestCase def test_redirect_url_match process :redirect_external assert @response.redirect? - assert @response.redirect_url_match?("rubyonrails") - assert @response.redirect_url_match?(/rubyonrails/) - assert !@response.redirect_url_match?("phpoffrails") - assert !@response.redirect_url_match?(/perloffrails/) + assert_deprecated do + assert @response.redirect_url_match?("rubyonrails") + assert @response.redirect_url_match?(/rubyonrails/) + assert !@response.redirect_url_match?("phpoffrails") + assert !@response.redirect_url_match?(/perloffrails/) + end end # check for a redirection |