From 16b9409a9c087d26e415de9fe66b8a754d76e7f0 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 5 Mar 2006 06:42:58 +0000 Subject: allow RJS enum values to be passed to visual_effect() and other scriptaculous helpers #4080 [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3772 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/new_render_test.rb | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 24a92d6f9e..1ae742d5ac 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -358,6 +358,18 @@ class NewRenderTest < Test::Unit::TestCase assert_equal "\n

Hello David

\n

This is grand!

\n\n", @response.body end + def test_enum_rjs_test + get :enum_rjs_test + assert_equal <<-EOS.strip, @response.body +$$('.product').each(function(value, index) { +new Effect.Highlight(element,{}); +new Effect.Highlight(value,{}); +Sortable.create(value, {onUpdate:function(){new Ajax.Request('/test/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize(value)})}}); +new Draggable(value, {}); +}); +EOS + end + def test_render_xml_with_default get :greeting assert_equal "

This is grand!

\n", @response.body @@ -365,17 +377,17 @@ class NewRenderTest < Test::Unit::TestCase def test_render_rjs_with_default get :delete_with_js - assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight('project-4',{});!, @response.body + assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight(\"project-4\",{});!, @response.body end def test_render_rjs_template_explicitly get :render_js_with_explicit_template - assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight('project-4',{});!, @response.body + assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight(\"project-4\",{});!, @response.body end def test_rendering_rjs_action_explicitly get :render_js_with_explicit_action_template - assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight('project-4',{});!, @response.body + assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight(\"project-4\",{});!, @response.body end def test_layout_rendering -- cgit v1.2.3