diff options
Diffstat (limited to 'actionpack/test/controller/mime_responds_test.rb')
-rw-r--r-- | actionpack/test/controller/mime_responds_test.rb | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index 41f80d0784..4a5e597500 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -1,6 +1,7 @@ require 'abstract_unit' require 'controller/fake_models' require 'active_support/core_ext/hash/conversions' +require 'active_support/core_ext/object/inclusion' class StarStarMimeController < ActionController::Base layout nil @@ -72,13 +73,12 @@ class RespondToController < ActionController::Base def using_defaults respond_to do |type| type.html - type.js type.xml end end def using_defaults_with_type_list - respond_to(:html, :js, :xml) + respond_to(:html, :xml) end def made_for_content_type @@ -129,7 +129,6 @@ class RespondToController < ActionController::Base def all_types_with_layout respond_to do |type| type.html - type.js end end @@ -158,7 +157,7 @@ class RespondToController < ActionController::Base protected def set_layout - if ["all_types_with_layout", "iphone_with_html_response_type"].include?(action_name) + if action_name.in?(["all_types_with_layout", "iphone_with_html_response_type"]) "respond_to/layouts/standard" elsif action_name == "iphone_with_html_response_type_without_layout" "respond_to/layouts/missing" @@ -298,11 +297,6 @@ class RespondToControllerTest < ActionController::TestCase assert_equal "text/html", @response.content_type assert_equal 'Hello world!', @response.body - @request.accept = "text/javascript" - get :using_defaults - assert_equal "text/javascript", @response.content_type - assert_equal '$("body").visualEffect("highlight");', @response.body - @request.accept = "application/xml" get :using_defaults assert_equal "application/xml", @response.content_type @@ -315,11 +309,6 @@ class RespondToControllerTest < ActionController::TestCase assert_equal "text/html", @response.content_type assert_equal 'Hello world!', @response.body - @request.accept = "text/javascript" - get :using_defaults_with_type_list - assert_equal "text/javascript", @response.content_type - assert_equal '$("body").visualEffect("highlight");', @response.body - @request.accept = "application/xml" get :using_defaults_with_type_list assert_equal "application/xml", @response.content_type @@ -427,13 +416,6 @@ class RespondToControllerTest < ActionController::TestCase assert_equal 'HTML', @response.body end - - def test_rjs_type_skips_layout - @request.accept = "text/javascript" - get :all_types_with_layout - assert_equal 'RJS for all_types_with_layout', @response.body - end - def test_html_type_with_layout @request.accept = "text/html" get :all_types_with_layout @@ -443,9 +425,6 @@ class RespondToControllerTest < ActionController::TestCase def test_xhr xhr :get, :js_or_html assert_equal 'JS', @response.body - - xhr :get, :using_defaults - assert_equal '$("body").visualEffect("highlight");', @response.body end def test_custom_constant @@ -642,11 +621,6 @@ class RespondWithControllerTest < ActionController::TestCase end def test_using_resource - @request.accept = "text/javascript" - get :using_resource - assert_equal "text/javascript", @response.content_type - assert_equal '$("body").visualEffect("highlight");', @response.body - @request.accept = "application/xml" get :using_resource assert_equal "application/xml", @response.content_type |