From f55ef82321c33a308c64e54c66b45e4fff542efa Mon Sep 17 00:00:00 2001 From: jejacks0n Date: Thu, 3 Jan 2013 20:51:44 -0700 Subject: 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. --- actionpack/test/fixtures/sprockets/app/javascripts/extra.js | 1 + actionpack/test/fixtures/sprockets/app/stylesheets/extra.css | 1 + actionpack/test/template/sprockets_helper_test.rb | 5 +++++ 3 files changed, 7 insertions(+) (limited to 'actionpack/test') 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{\n}, javascript_include_tag(:application) + assert_match %r{\n\n}, + javascript_include_tag(:application, :extra) end test "stylesheet path through asset_path" do @@ -324,6 +326,9 @@ class SprocketsHelperTest < ActionView::TestCase assert_match %r{\n}, stylesheet_link_tag(:application) + assert_match %r{\n\n}, + stylesheet_link_tag(:application, :extra) + assert_match %r{\n}, stylesheet_link_tag(:application, :media => "print") end -- cgit v1.2.3