diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/content_type_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/send_file_test.rb | 10 |
2 files changed, 6 insertions, 8 deletions
diff --git a/actionpack/test/controller/content_type_test.rb b/actionpack/test/controller/content_type_test.rb index d622ac1e85..511788aec8 100644 --- a/actionpack/test/controller/content_type_test.rb +++ b/actionpack/test/controller/content_type_test.rb @@ -83,14 +83,14 @@ class ContentTypeTest < ActionController::TestCase # :ported: def test_content_type_from_body get :render_content_type_from_body - assert_equal "application/rss+xml", @response.content_type + assert_equal Mime::RSS, @response.content_type assert_equal "utf-8", @response.charset end # :ported: def test_content_type_from_render get :render_content_type_from_render - assert_equal "application/rss+xml", @response.content_type + assert_equal Mime::RSS, @response.content_type assert_equal "utf-8", @response.charset end diff --git a/actionpack/test/controller/send_file_test.rb b/actionpack/test/controller/send_file_test.rb index 0bc0eb2df6..4134da3b9e 100644 --- a/actionpack/test/controller/send_file_test.rb +++ b/actionpack/test/controller/send_file_test.rb @@ -91,10 +91,10 @@ class SendFileTest < ActionController::TestCase def test_headers_after_send_shouldnt_include_charset response = process('data') - assert_equal "application/octet-stream", response.content_type + assert_equal "application/octet-stream", response.headers["Content-Type"] response = process('file') - assert_equal "application/octet-stream", response.content_type + assert_equal "application/octet-stream", response.headers["Content-Type"] end # Test that send_file_headers! is setting the correct HTTP headers. @@ -116,7 +116,7 @@ class SendFileTest < ActionController::TestCase h = @controller.headers assert_equal 1, h['Content-Length'] - assert_equal 'image/png', h['Content-Type'] + assert_equal 'image/png', @controller.content_type assert_equal 'disposition; filename="filename"', h['Content-Disposition'] assert_equal 'binary', h['Content-Transfer-Encoding'] @@ -136,9 +136,7 @@ class SendFileTest < ActionController::TestCase @controller.headers = {} @controller.send(:send_file_headers!, options) - headers = @controller.headers - - assert_equal 'image/png', headers['Content-Type'] + assert_equal 'image/png', @controller.content_type end |