aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/sprockets_helper_test.rb
diff options
context:
space:
mode:
authorjejacks0n <jejacks0n@gmail.com>2013-01-03 20:51:44 -0700
committerjejacks0n <jejacks0n@gmail.com>2013-01-10 13:41:52 -0700
commitf55ef82321c33a308c64e54c66b45e4fff542efa (patch)
treeb03852e20e717e0daeccf78eb2ccd00d5acdff86 /actionpack/test/template/sprockets_helper_test.rb
parent11f5debcd5bbfaf51d2d2f24f2c5cee38f37fcdb (diff)
downloadrails-f55ef82321c33a308c64e54c66b45e4fff542efa.tar.gz
rails-f55ef82321c33a308c64e54c66b45e4fff542efa.tar.bz2
rails-f55ef82321c33a308c64e54c66b45e4fff542efa.zip
Fixes issue where duplicate assets can be required with sprockets.
- addresses the problem by calling flatten on asset array before calling uniq. - adds note to CHANGELOG.
Diffstat (limited to 'actionpack/test/template/sprockets_helper_test.rb')
-rw-r--r--actionpack/test/template/sprockets_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb
index e944cfaee3..01dd66aa1f 100644
--- a/actionpack/test/template/sprockets_helper_test.rb
+++ b/actionpack/test/template/sprockets_helper_test.rb
@@ -266,6 +266,8 @@ class SprocketsHelperTest < ActionView::TestCase
javascript_include_tag('/javascripts/application')
assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>},
javascript_include_tag(:application)
+ assert_match %r{<script src="/assets/xmlhr-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/application-[0-9a-f]+.js\?body=1" type="text/javascript"></script>\n<script src="/assets/extra-[0-9a-f]+.js\?body=1" type="text/javascript"></script>},
+ javascript_include_tag(:application, :extra)
end
test "stylesheet path through asset_path" do
@@ -324,6 +326,9 @@ class SprocketsHelperTest < ActionView::TestCase
assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />},
stylesheet_link_tag(:application)
+ assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/extra-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />},
+ stylesheet_link_tag(:application, :extra)
+
assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="print" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="print" rel="stylesheet" type="text/css" />},
stylesheet_link_tag(:application, :media => "print")
end