From 9532d746a998f790a5c0c61caff17beeb43f39f0 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Sun, 5 Sep 2010 22:59:41 -0300 Subject: Cleanup deprecations in Action Dispatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- .../test/controller/action_pack_assertions_test.rb | 27 +++++----------------- actionpack/test/controller/test_test.rb | 7 ------ 2 files changed, 6 insertions(+), 28 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index c805742359..4f215c6df1 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -315,33 +315,22 @@ class ActionPackAssertionsControllerTest < ActionController::TestCase # check the empty flashing def test_flash_me_naked process :flash_me_naked - assert_deprecated do - assert !@response.has_flash? - assert !@response.has_flash_with_contents? - end + assert flash.empty? end # check if we have flash objects def test_flash_haves process :flash_me - assert_deprecated do - assert @response.has_flash? - assert @response.has_flash_with_contents? - assert @response.has_flash_object?('hello') - end + assert flash.any? + assert_present flash['hello'] end # ensure we don't have flash objects def test_flash_have_nots process :nothing - assert_deprecated do - assert !@response.has_flash? - assert !@response.has_flash_with_contents? - assert_nil @response.flash['hello'] - end + assert flash.empty? end - # check if we were rendered by a file-based template? def test_rendered_action process :nothing @@ -393,12 +382,8 @@ class ActionPackAssertionsControllerTest < ActionController::TestCase def test_redirect_url_match process :redirect_external assert @response.redirect? - 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 + assert_match /rubyonrails/, @response.redirect_url + assert !/perloffrails/.match(@response.redirect_url) end # check for a redirection diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index fc7d314e04..e90fc49542 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -674,13 +674,6 @@ XML assert_redirected_to 'created resource' end end - - def test_binary_content_works_with_send_file - get :test_send_file - assert_deprecated do - assert_nothing_raised(NoMethodError) { @response.binary_content } - end - end end class InferringClassNameTest < ActionController::TestCase -- cgit v1.2.3