From 09195f10bd3add1be1983a42760113ef2bd31602 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 16 Dec 2010 08:12:24 +0100 Subject: Do not use the same hash instance for expansions [#6114 state:resolved] Using the same hash instance makes using the same expansions for both javascripts and stylesheets. --- actionpack/test/template/asset_tag_helper_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (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 fbcc99a17a..39ecafd072 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -273,6 +273,14 @@ class AssetTagHelperTest < ActionView::TestCase assert_raise(ArgumentError) { javascript_include_tag('first', :monkey, 'last') } end + def test_custom_javascript_and_stylesheet_expansion_with_same_name + ENV["RAILS_ASSET_ID"] = "" + ActionView::Helpers::AssetTagHelper::register_javascript_expansion :robbery => ["bank", "robber"] + ActionView::Helpers::AssetTagHelper::register_stylesheet_expansion :robbery => ["money", "security"] + assert_dom_equal %(\n\n\n), javascript_include_tag('controls', :robbery, 'effects') + assert_dom_equal %(\n\n\n), stylesheet_link_tag('style', :robbery, 'print') + end + def test_reset_javascript_expansions JavascriptIncludeTag.expansions.clear assert_raise(ArgumentError) { javascript_include_tag(:defaults) } -- cgit v1.2.3