aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAdam McCrea <adam@adamlogic.com>2009-02-05 15:23:05 -0600
committerJoshua Peek <josh@joshpeek.com>2009-02-05 15:23:05 -0600
commit06182ea02e92afad579998aa80144588e8865ac3 (patch)
tree075368c3a5026a26f0d13de95830fbe7ac2d4521 /actionpack/test
parentb6e7a76cc573ee35c1df648f35d5865672f55e15 (diff)
downloadrails-06182ea02e92afad579998aa80144588e8865ac3.tar.gz
rails-06182ea02e92afad579998aa80144588e8865ac3.tar.bz2
rails-06182ea02e92afad579998aa80144588e8865ac3.zip
implicitly rendering a js response should not use the default layout [#1844 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/render_test.rb11
-rw-r--r--actionpack/test/fixtures/test/render_implicit_js_template_without_layout.js.erb1
2 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 584b9277c4..e131a735a9 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -277,6 +277,9 @@ class TestController < ActionController::Base
def render_implicit_html_template_from_xhr_request
end
+ def render_implicit_js_template_without_layout
+ end
+
def formatted_html_erb
end
@@ -681,7 +684,8 @@ class TestController < ActionController::Base
"render_with_explicit_string_template",
"render_js_with_explicit_template",
"render_js_with_explicit_action_template",
- "delete_with_js", "update_page", "update_page_with_instance_variables"
+ "delete_with_js", "update_page", "update_page_with_instance_variables",
+ "render_implicit_js_template_without_layout"
"layouts/standard"
when "action_talk_to_layout", "layout_overriding_layout"
@@ -1018,6 +1022,11 @@ class RenderTest < ActionController::TestCase
assert_equal "Hello HTML!", @response.body
end
+ def test_should_implicitly_render_js_template_without_layout
+ get :render_implicit_js_template_without_layout, :format => :js
+ assert_no_match /<html>/, @response.body
+ end
+
def test_should_render_formatted_template
get :formatted_html_erb
assert_equal 'formatted html erb', @response.body
diff --git a/actionpack/test/fixtures/test/render_implicit_js_template_without_layout.js.erb b/actionpack/test/fixtures/test/render_implicit_js_template_without_layout.js.erb
new file mode 100644
index 0000000000..d5b94af505
--- /dev/null
+++ b/actionpack/test/fixtures/test/render_implicit_js_template_without_layout.js.erb
@@ -0,0 +1 @@
+alert('hello');