diff options
Diffstat (limited to 'actionpack/test/controller/action_pack_assertions_test.rb')
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 56ba36cee5..7050000dd8 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -165,13 +165,11 @@ module Admin end # a test case to exercise the new capabilities TestRequest & TestResponse -class ActionPackAssertionsControllerTest < Test::Unit::TestCase +class ActionPackAssertionsControllerTest < ActionController::TestCase # let's get this party started def setup ActionController::Routing::Routes.reload ActionController::Routing.use_controllers!(%w(action_pack_assertions admin/inner_module user content admin/user)) - @controller = ActionPackAssertionsController.new - @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new end def teardown @@ -235,13 +233,13 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase map.connect ':controller/:action/:id' end process :redirect_to_named_route - assert_raise(Test::Unit::AssertionFailedError) do + assert_raise(ActiveSupport::TestCase::Assertion) do assert_redirected_to 'http://test.host/route_two' end - assert_raise(Test::Unit::AssertionFailedError) do + assert_raise(ActiveSupport::TestCase::Assertion) do assert_redirected_to :controller => 'action_pack_assertions', :action => 'nothing', :id => 'two' end - assert_raise(Test::Unit::AssertionFailedError) do + assert_raise(ActiveSupport::TestCase::Assertion) do assert_redirected_to route_two_url end end @@ -410,7 +408,7 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase def test_assert_redirection_fails_with_incorrect_controller process :redirect_to_controller - assert_raise(Test::Unit::AssertionFailedError) do + assert_raise(ActiveSupport::TestCase::Assertion) do assert_redirected_to :controller => "action_pack_assertions", :action => "flash_me" end end @@ -466,7 +464,7 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase begin assert_valid assigns('record') assert false - rescue Test::Unit::AssertionFailedError => e + rescue ActiveSupport::TestCase::Assertion => e end end @@ -475,7 +473,7 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase get :index assert_response :success flunk 'Expected non-success response' - rescue Test::Unit::AssertionFailedError => e + rescue ActiveSupport::TestCase::Assertion => e assert e.message.include?('FAIL') end @@ -484,17 +482,15 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase get :show assert_response :success flunk 'Expected non-success response' - rescue Test::Unit::AssertionFailedError + rescue ActiveSupport::TestCase::Assertion + # success rescue flunk "assert_response failed to handle failure response with missing, but optional, exception." end end -class ActionPackHeaderTest < Test::Unit::TestCase - def setup - @controller = ActionPackAssertionsController.new - @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new - end +class ActionPackHeaderTest < ActionController::TestCase + tests ActionPackAssertionsController def test_rendering_xml_sets_content_type process :hello_xml_world |