diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-06-02 14:34:11 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-06-07 21:48:24 +0200 |
commit | 5b0a8916ea5a7c565aaf27964bf19a8f3bf5f558 (patch) | |
tree | 2df0cc990fc8fd8d496fdc5cbbac690088bf5323 /actionpack/test/template | |
parent | 68d3e1f42f7de671a07cf1eb9de577fa2f8c82f0 (diff) | |
download | rails-5b0a8916ea5a7c565aaf27964bf19a8f3bf5f558.tar.gz rails-5b0a8916ea5a7c565aaf27964bf19a8f3bf5f558.tar.bz2 rails-5b0a8916ea5a7c565aaf27964bf19a8f3bf5f558.zip |
Fix asset tags for files with more than one dot
After the fix done in 39f9f02a, there are cases that will not work
correctly. If you have file with "2 extensions", like foo.min.js and you
reference the file without extension, like:
javascript_include_tag "foo.min"
it will fail because sprockets finds foo.min.js with foo.min argument.
This commit fixes this case and will get the right file even when
referrencing it without extension.
(closes #6598)
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/sprockets_helper_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index 65107b54b7..b908b6777c 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -257,6 +257,9 @@ class SprocketsHelperTest < ActionView::TestCase assert_match %r{\A<script src="/assets/xmlhr-[0-9a-f]+.js" type="text/javascript"></script>\Z}, javascript_include_tag("xmlhr", "xmlhr") + assert_match %r{\A<script src="/assets/foo.min-[0-9a-f]+.js" type="text/javascript"></script>\Z}, + javascript_include_tag("foo.min") + @config.assets.compile = true @config.assets.debug = true assert_match %r{<script src="/javascripts/application.js" type="text/javascript"></script>}, @@ -310,6 +313,9 @@ class SprocketsHelperTest < ActionView::TestCase assert_match %r{\A<link href="/assets/style-[0-9a-f]+.ext" media="screen" rel="stylesheet" type="text/css" />\Z}, stylesheet_link_tag("style.ext") + assert_match %r{\A<link href="/assets/style.min-[0-9a-f]+.css" media="screen" rel="stylesheet" type="text/css" />\Z}, + stylesheet_link_tag("style.min") + @config.assets.compile = true @config.assets.debug = true assert_match %r{<link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />}, |