diff options
author | jejacks0n <jejacks0n@gmail.com> | 2013-01-03 20:51:44 -0700 |
---|---|---|
committer | jejacks0n <jejacks0n@gmail.com> | 2013-01-10 13:41:52 -0700 |
commit | f55ef82321c33a308c64e54c66b45e4fff542efa (patch) | |
tree | b03852e20e717e0daeccf78eb2ccd00d5acdff86 /actionpack/test | |
parent | 11f5debcd5bbfaf51d2d2f24f2c5cee38f37fcdb (diff) | |
download | rails-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')
3 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/fixtures/sprockets/app/javascripts/extra.js b/actionpack/test/fixtures/sprockets/app/javascripts/extra.js index e69de29bb2..e611d2b129 100644 --- a/actionpack/test/fixtures/sprockets/app/javascripts/extra.js +++ b/actionpack/test/fixtures/sprockets/app/javascripts/extra.js @@ -0,0 +1 @@ +//= require xmlhr diff --git a/actionpack/test/fixtures/sprockets/app/stylesheets/extra.css b/actionpack/test/fixtures/sprockets/app/stylesheets/extra.css index e69de29bb2..2365eaa4cd 100644 --- a/actionpack/test/fixtures/sprockets/app/stylesheets/extra.css +++ b/actionpack/test/fixtures/sprockets/app/stylesheets/extra.css @@ -0,0 +1 @@ +/*= require style */ 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 |