aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-16 16:46:56 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-17 12:54:18 -0700
commitde388ba864ab47cbb3d92b3a36af254540788ed5 (patch)
tree2a4b173cc001755191ed91db81871cdec7d923c1 /actionpack/test/controller
parent1c4d28ba314c8cdd0039becf3bc9e678219b8f46 (diff)
downloadrails-de388ba864ab47cbb3d92b3a36af254540788ed5.tar.gz
rails-de388ba864ab47cbb3d92b3a36af254540788ed5.tar.bz2
rails-de388ba864ab47cbb3d92b3a36af254540788ed5.zip
Fix pending test about content-type
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/action_pack_assertions_test.rb24
1 files changed, 19 insertions, 5 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb
index 24686ab4b6..ecbaba39d1 100644
--- a/actionpack/test/controller/action_pack_assertions_test.rb
+++ b/actionpack/test/controller/action_pack_assertions_test.rb
@@ -13,6 +13,18 @@ class ActionPackAssertionsController < ActionController::Base
# a standard template
def hello_xml_world() render :template => "test/hello_xml_world"; end
+ # a standard template rendering PDF
+ def hello_xml_world_pdf
+ self.content_type = "application/pdf"
+ render :template => "test/hello_xml_world"
+ end
+
+ # a standard template rendering PDF
+ def hello_xml_world_pdf_header
+ response.headers["Content-Type"] = "application/pdf; charset=utf-8"
+ render :template => "test/hello_xml_world"
+ end
+
# a standard partial
def partial() render :partial => 'test/partial'; end
@@ -537,11 +549,13 @@ class ActionPackHeaderTest < ActionController::TestCase
end
def test_rendering_xml_respects_content_type
- pending do
- @response.headers['type'] = 'application/pdf'
- process :hello_xml_world
- assert_equal('application/pdf; charset=utf-8', @response.headers['Content-Type'])
- end
+ process :hello_xml_world_pdf
+ assert_equal('application/pdf; charset=utf-8', @response.headers['Content-Type'])
+ end
+
+ def test_rendering_xml_respects_content_type_when_set_in_the_header
+ process :hello_xml_world_pdf_header
+ assert_equal('application/pdf; charset=utf-8', @response.headers['Content-Type'])
end
def test_render_text_with_custom_content_type