diff options
Diffstat (limited to 'actionpack/test/controller/new_base')
-rw-r--r-- | actionpack/test/controller/new_base/content_type_test.rb | 9 | ||||
-rw-r--r-- | actionpack/test/controller/new_base/render_layout_test.rb | 16 |
2 files changed, 10 insertions, 15 deletions
diff --git a/actionpack/test/controller/new_base/content_type_test.rb b/actionpack/test/controller/new_base/content_type_test.rb index 8ba30944f5..4b70031c90 100644 --- a/actionpack/test/controller/new_base/content_type_test.rb +++ b/actionpack/test/controller/new_base/content_type_test.rb @@ -23,8 +23,7 @@ module ContentType "content_type/implied/i_am_html_erb.html.erb" => "Hello world!", "content_type/implied/i_am_xml_erb.xml.erb" => "<xml>Hello world!</xml>", "content_type/implied/i_am_html_builder.html.builder" => "xml.p 'Hello'", - "content_type/implied/i_am_xml_builder.xml.builder" => "xml.awesome 'Hello'", - "content_type/implied/i_am_js_rjs.js.rjs" => "page.alert 'hello'" + "content_type/implied/i_am_xml_builder.xml.builder" => "xml.awesome 'Hello'" )] end @@ -93,12 +92,6 @@ module ContentType assert_header "Content-Type", "application/xml; charset=utf-8" end - - test "sets Content-Type as text/javascript when rendering *.js" do - get "/content_type/implied/i_am_js_rjs", "format" => "js" - - assert_header "Content-Type", "text/javascript; charset=utf-8" - end end class ExplicitCharsetTest < Rack::TestCase diff --git a/actionpack/test/controller/new_base/render_layout_test.rb b/actionpack/test/controller/new_base/render_layout_test.rb index bb2a953536..d3dcb5cad6 100644 --- a/actionpack/test/controller/new_base/render_layout_test.rb +++ b/actionpack/test/controller/new_base/render_layout_test.rb @@ -70,8 +70,8 @@ module ControllerLayouts class MismatchFormatController < ::ApplicationController self.view_paths = [ActionView::FixtureResolver.new( "layouts/application.html.erb" => "<html><%= yield %></html>", - "controller_layouts/mismatch_format/index.js.rjs" => "page[:test].ext", - "controller_layouts/mismatch_format/implicit.rjs" => "page[:test].ext" + "controller_layouts/mismatch_format/index.xml.builder" => "xml.instruct!", + "controller_layouts/mismatch_format/implicit.builder" => "xml.instruct!" )] def explicit @@ -81,15 +81,17 @@ module ControllerLayouts class MismatchFormatTest < Rack::TestCase testing ControllerLayouts::MismatchFormatController + + XML_INSTRUCT = %Q(<?xml version="1.0" encoding="UTF-8"?>\n) - test "if JS is selected, an HTML template is not also selected" do - get :index, "format" => "js" - assert_response "$(\"test\").ext();" + test "if XML is selected, an HTML template is not also selected" do + get :index, :format => "xml" + assert_response XML_INSTRUCT end - test "if JS is implicitly selected, an HTML template is not also selected" do + test "if XML is implicitly selected, an HTML template is not also selected" do get :implicit - assert_response "$(\"test\").ext();" + assert_response XML_INSTRUCT end test "if an HTML template is explicitly provides for a JS template, an error is raised" do |