test/controller/mime_responds_test.rb in actionpack-2.2.3 vs test/controller/mime_responds_test.rb in actionpack-2.3.2

- old
+ new

@@ -160,17 +160,15 @@ "respond_to/layouts/missing" end end end -class MimeControllerTest < Test::Unit::TestCase +class MimeControllerTest < ActionController::TestCase + tests RespondToController + def setup ActionController::Base.use_accept_header = true - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - - @controller = RespondToController.new @request.host = "www.example.com" end def teardown ActionController::Base.use_accept_header = false @@ -469,11 +467,11 @@ def test_format_with_custom_response_type_and_request_headers_with_only_one_layout_present get :iphone_with_html_response_type_without_layout assert_equal '<html><div id="html_missing">Hello future from Firefox!</div></html>', @response.body @request.accept = "text/iphone" - assert_raises(ActionView::MissingTemplate) { get :iphone_with_html_response_type_without_layout } + assert_raise(ActionView::MissingTemplate) { get :iphone_with_html_response_type_without_layout } end end class AbstractPostController < ActionController::Base self.view_paths = File.dirname(__FILE__) + "/../fixtures/post_test/" @@ -507,15 +505,13 @@ type.iphone end end end -class MimeControllerLayoutsTest < Test::Unit::TestCase - def setup - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new +class MimeControllerLayoutsTest < ActionController::TestCase + tests PostController - @controller = PostController.new + def setup @request.host = "www.example.com" end def test_missing_layout_renders_properly get :index