mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix pending test about content-type
This commit is contained in:
parent
1c4d28ba31
commit
de388ba864
1 changed files with 19 additions and 5 deletions
|
@ -13,6 +13,18 @@ class ActionPackAssertionsController < ActionController::Base
|
||||||
# a standard template
|
# a standard template
|
||||||
def hello_xml_world() render :template => "test/hello_xml_world"; end
|
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
|
# a standard partial
|
||||||
def partial() render :partial => 'test/partial'; end
|
def partial() render :partial => 'test/partial'; end
|
||||||
|
|
||||||
|
@ -537,11 +549,13 @@ class ActionPackHeaderTest < ActionController::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_rendering_xml_respects_content_type
|
def test_rendering_xml_respects_content_type
|
||||||
pending do
|
process :hello_xml_world_pdf
|
||||||
@response.headers['type'] = 'application/pdf'
|
assert_equal('application/pdf; charset=utf-8', @response.headers['Content-Type'])
|
||||||
process :hello_xml_world
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
def test_render_text_with_custom_content_type
|
def test_render_text_with_custom_content_type
|
||||||
|
|
Loading…
Reference in a new issue