From fed41fbe8b79725904437230ac9e7abfb53df651 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 28 Feb 2006 05:16:34 +0000 Subject: Added support to AssetTagHelper#javascript_include_tag for having :defaults appear anywhere in the list, so you can now make one call ala javascript_include_tag(:defaults, "my_scripts") or javascript_include_tag("my_scripts", :defaults) depending on how you want the load order (closes #3506) [Bob Silva] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3696 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/asset_tag_helper_test.rb | 6 ++++-- actionpack/test/template/scriptaculous_helper_test.rb | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb index 5e2d46cbf8..a4e1795b3e 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -49,7 +49,9 @@ class AssetTagHelperTest < Test::Unit::TestCase %(javascript_include_tag("xmlhr")) => %(), %(javascript_include_tag("xmlhr", :lang => "vbscript")) => %(), %(javascript_include_tag("common.javascript", "/elsewhere/cools")) => %(\n), - %(javascript_include_tag(:defaults)) => %(\n\n\n) + %(javascript_include_tag(:defaults)) => %(\n\n\n), + %(javascript_include_tag(:defaults, "test")) => %(\n\n\n\n), + %(javascript_include_tag("test", :defaults)) => %(\n\n\n\n) } StylePathToTag = { @@ -95,7 +97,7 @@ class AssetTagHelperTest < Test::Unit::TestCase ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'lib1', '/elsewhere/blub/lib2' assert_dom_equal %(\n\n\n\n\n\n), javascript_include_tag(:defaults) end - + def test_style_path StylePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end diff --git a/actionpack/test/template/scriptaculous_helper_test.rb b/actionpack/test/template/scriptaculous_helper_test.rb index 80647f24c0..0a76f7d652 100644 --- a/actionpack/test/template/scriptaculous_helper_test.rb +++ b/actionpack/test/template/scriptaculous_helper_test.rb @@ -28,11 +28,11 @@ class ScriptaculousHelperTest < Test::Unit::TestCase assert_equal "new Effect.Fade('fademe',{duration:4.0});", visual_effect(:fade, "fademe", :duration => 4.0) assert_equal "new Effect.Shake(element,{});", visual_effect(:shake) assert_equal "new Effect.DropOut('dropme',{queue:'end'});", visual_effect(:drop_out, 'dropme', :queue => :end) - assert_equal "new Effect.DropOut('dropme',{queue:{scope:'test',limit:2,position:'end'}});", + assert_equal "new Effect.DropOut('dropme',{queue:{limit:2,scope:'test',position:'end'}});", visual_effect(:drop_out, 'dropme', :queue => {:position => "end", :scope => "test", :limit => 2}) - assert_equal "new Effect.DropOut('dropme',{queue:{scope:'list',limit:2}});", + assert_equal "new Effect.DropOut('dropme',{queue:{limit:2,scope:'list'}});", visual_effect(:drop_out, 'dropme', :queue => {:scope => :list, :limit => 2}) - assert_equal "new Effect.DropOut('dropme',{queue:{scope:'test',limit:2,position:'end'}});", + assert_equal "new Effect.DropOut('dropme',{queue:{limit:2,scope:'test',position:'end'}});", visual_effect(:drop_out, 'dropme', :queue => {:position => :end, :scope => :test, :limit => 2}) end -- cgit v1.2.3