aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-03-25 23:12:09 +0100
committerXavier Noria <fxn@hashref.com>2011-04-13 13:23:18 +0200
commit5850f1693546f14420bf0bc630a48650f0d606d5 (patch)
tree0e7e1b631c5d4e0b85af3b448f39dbf4cb483cb8 /actionpack/test/controller
parenteea66892c80d51c1b959171c2e3feac67124aaba (diff)
downloadrails-5850f1693546f14420bf0bc630a48650f0d606d5.tar.gz
rails-5850f1693546f14420bf0bc630a48650f0d606d5.tar.bz2
rails-5850f1693546f14420bf0bc630a48650f0d606d5.zip
removes the RJS template handler
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/caching_test.rb14
-rw-r--r--actionpack/test/controller/content_type_test.rb9
-rw-r--r--actionpack/test/controller/mime_responds_test.rb29
-rw-r--r--actionpack/test/controller/new_base/content_type_test.rb9
-rw-r--r--actionpack/test/controller/new_base/render_layout_test.rb16
5 files changed, 11 insertions, 66 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb
index 01f3e8f2b6..fada0c7748 100644
--- a/actionpack/test/controller/caching_test.rb
+++ b/actionpack/test/controller/caching_test.rb
@@ -713,17 +713,10 @@ class FunctionalCachingController < CachingController
end
end
- def js_fragment_cached_with_partial
- respond_to do |format|
- format.js
- end
- end
-
def formatted_fragment_cached
respond_to do |format|
format.html
format.xml
- format.js
end
end
@@ -770,13 +763,6 @@ CACHED
assert_match("Some cached content", @store.read('views/test.host/functional_caching/inline_fragment_cached'))
end
- def test_fragment_caching_in_rjs_partials
- xhr :get, :js_fragment_cached_with_partial
- assert_response :success
- assert_match(/Old fragment caching in a partial/, @response.body)
- assert_match("Old fragment caching in a partial", @store.read('views/test.host/functional_caching/js_fragment_cached_with_partial'))
- end
-
def test_html_formatted_fragment_caching
get :formatted_fragment_cached, :format => "html"
assert_response :success
diff --git a/actionpack/test/controller/content_type_test.rb b/actionpack/test/controller/content_type_test.rb
index 9500c25a32..b12c798302 100644
--- a/actionpack/test/controller/content_type_test.rb
+++ b/actionpack/test/controller/content_type_test.rb
@@ -35,9 +35,6 @@ class OldContentTypeController < ActionController::Base
def render_default_for_builder
end
- def render_default_for_rjs
- end
-
def render_change_for_builder
response.content_type = Mime::HTML
render :action => "render_default_for_builder"
@@ -129,12 +126,6 @@ class ContentTypeTest < ActionController::TestCase
assert_equal "utf-8", @response.charset
end
- def test_default_for_rjs
- xhr :post, :render_default_for_rjs
- assert_equal Mime::JS, @response.content_type
- assert_equal "utf-8", @response.charset
- end
-
def test_change_for_builder
get :render_change_for_builder
assert_equal Mime::HTML, @response.content_type
diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb
index be5866e5aa..9e09fc39ed 100644
--- a/actionpack/test/controller/mime_responds_test.rb
+++ b/actionpack/test/controller/mime_responds_test.rb
@@ -73,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
@@ -130,7 +129,6 @@ class RespondToController < ActionController::Base
def all_types_with_layout
respond_to do |type|
type.html
- type.js
end
end
@@ -299,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
@@ -316,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
@@ -428,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
@@ -444,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
@@ -643,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
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