diff options
Diffstat (limited to 'actionpack/test/controller/new_base')
-rw-r--r-- | actionpack/test/controller/new_base/render_rjs_test.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/actionpack/test/controller/new_base/render_rjs_test.rb b/actionpack/test/controller/new_base/render_rjs_test.rb index 7c8f1cb869..b602b9f8e9 100644 --- a/actionpack/test/controller/new_base/render_rjs_test.rb +++ b/actionpack/test/controller/new_base/render_rjs_test.rb @@ -5,7 +5,7 @@ module RenderRjs self.view_paths = [ActionView::FixtureResolver.new( "render_rjs/basic/index.js.rjs" => "page[:customer].replace_html render(:partial => 'customer')", "render_rjs/basic/index_html.js.rjs" => "page[:customer].replace_html :partial => 'customer'", - "render_rjs/basic/index_no_js.js.rjs" => "page[:developer].replace_html render(:partial => 'developer')", + "render_rjs/basic/index_no_js.js.erb" => "<%= render(:partial => 'developer') %>", "render_rjs/basic/_customer.js.erb" => "JS Partial", "render_rjs/basic/_customer.html.erb" => "HTML Partial", "render_rjs/basic/_developer.html.erb" => "HTML Partial", @@ -18,6 +18,12 @@ module RenderRjs render end + def index_respond_to + respond_to do |format| + format.js { render :action => "index_no_js" } + end + end + def index_locale self.locale = :da end @@ -41,7 +47,12 @@ module RenderRjs test "rendering a partial in an RJS template should pick the HTML one if no JS is available" do get :index_no_js, "format" => "js" - assert_response("$(\"developer\").update(\"HTML Partial\");") + assert_response("HTML Partial") + end + + test "rendering a partial in an RJS template should pick the HTML one if no JS is available on respond_to" do + get :index_respond_to, "format" => "js" + assert_response("HTML Partial") end test "replacing an element with a partial in an RJS template should pick the HTML template over the JS one" do |