diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-06-05 16:51:49 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-06-05 16:51:49 +0000 |
commit | b83efadb32fe55ba7a7d23d650a8adc1a351eab7 (patch) | |
tree | a92fd4097bcbf43479ce0e3ab196be4c6398371b /actionpack/test | |
parent | ed1ed9ed97f7d30ba8221079365634aa9c4bf24c (diff) | |
download | rails-b83efadb32fe55ba7a7d23d650a8adc1a351eab7.tar.gz rails-b83efadb32fe55ba7a7d23d650a8adc1a351eab7.tar.bz2 rails-b83efadb32fe55ba7a7d23d650a8adc1a351eab7.zip |
Assume html format when rendering partials in RJS. #8076 [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6950 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 15 | ||||
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 510d1a8765..8b4149dcb4 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -142,6 +142,16 @@ class TestController < ActionController::Base end end + def respond_to_partial_as_rjs + respond_to do |format| + format.js do + render :update do |page| + page.replace :foo, :partial => 'partial' + end + end + end + end + def rescue_action(e) raise end private @@ -388,6 +398,11 @@ class RenderTest < Test::Unit::TestCase assert_equal %(Element.replace("foo", "partial html");), @response.body end + def test_should_render_html_formatted_partial_with_rjs_and_js_format + xhr :get, :respond_to_partial_as_rjs + assert_equal %(Element.replace("foo", "partial html");), @response.body + end + def test_should_render_js_partial xhr :get, :partial, :format => 'js' assert_equal 'partial js', @response.body diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index b669d20b22..c08bf9c85e 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -15,6 +15,10 @@ class Author::Nested < Author; end module BaseTest + def self.included(base) + base.send :attr_accessor, :template_format + end + include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::PrototypeHelper include ActionView::Helpers::ScriptaculousHelper |