Skip to content

Commit

Permalink
Avoid conflicts with another ContentTypeController used in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Sep 19, 2009
1 parent f05b1e5 commit 12b3799
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions actionpack/test/controller/content_type_test.rb
@@ -1,6 +1,6 @@
require 'abstract_unit' require 'abstract_unit'


class ContentTypeController < ActionController::Base class OldContentTypeController < ActionController::Base
# :ported: # :ported:
def render_content_type_from_body def render_content_type_from_body
response.content_type = Mime::RSS response.content_type = Mime::RSS
Expand Down Expand Up @@ -56,7 +56,7 @@ def rescue_action(e) raise end
end end


class ContentTypeTest < ActionController::TestCase class ContentTypeTest < ActionController::TestCase
tests ContentTypeController tests OldContentTypeController


def setup def setup
super super
Expand All @@ -73,11 +73,11 @@ def test_render_defaults
end end


def test_render_changed_charset_default def test_render_changed_charset_default
ContentTypeController.default_charset = "utf-16" OldContentTypeController.default_charset = "utf-16"
get :render_defaults get :render_defaults
assert_equal "utf-16", @response.charset assert_equal "utf-16", @response.charset
assert_equal Mime::HTML, @response.content_type assert_equal Mime::HTML, @response.content_type
ContentTypeController.default_charset = "utf-8" OldContentTypeController.default_charset = "utf-8"
end end


# :ported: # :ported:
Expand Down Expand Up @@ -109,12 +109,12 @@ def test_nil_charset_from_body
end end


def test_nil_default_for_rhtml def test_nil_default_for_rhtml
ContentTypeController.default_charset = nil OldContentTypeController.default_charset = nil
get :render_default_for_rhtml get :render_default_for_rhtml
assert_equal Mime::HTML, @response.content_type assert_equal Mime::HTML, @response.content_type
assert_nil @response.charset, @response.headers.inspect assert_nil @response.charset, @response.headers.inspect
ensure ensure
ContentTypeController.default_charset = "utf-8" OldContentTypeController.default_charset = "utf-8"
end end


def test_default_for_rhtml def test_default_for_rhtml
Expand Down Expand Up @@ -143,8 +143,7 @@ def test_change_for_rxml
end end


class AcceptBasedContentTypeTest < ActionController::TestCase class AcceptBasedContentTypeTest < ActionController::TestCase

tests OldContentTypeController
tests ContentTypeController


def setup def setup
super super
Expand Down

0 comments on commit 12b3799

Please sign in to comment.