From 39f9f02ab04973b213bef8c6f4c1a71043ed709d Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Mon, 21 May 2012 15:32:13 +0300 Subject: Assets: don't add extension if other given and file exists We should lookup if asset without appended extension exists. When sprockets are disabled the asset tag helpers incorporate this logic. When sprockets are enabled we should have the same logic. For example, we have style.ext file in app/assets/stylesheets and we use stylesheet_link_tag in the layout. In this case we should have /assets/style.ext instead of /assets/style.ext.css in the output. Closes #6310 --- actionpack/test/template/sprockets_helper_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index fc3c87a72e..65107b54b7 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -307,6 +307,9 @@ class SprocketsHelperTest < ActionView::TestCase assert_match %r{\A\Z}, stylesheet_link_tag("style", "style") + assert_match %r{\A\Z}, + stylesheet_link_tag("style.ext") + @config.assets.compile = true @config.assets.debug = true assert_match %r{}, -- cgit v1.2.3