mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #3718 from lest/fix-javascript-include-tag
javascript_include_tag should add '.js' to sources that contain '.'
This commit is contained in:
@@ -154,7 +154,7 @@ module Sprockets
|
||||
end
|
||||
|
||||
def rewrite_extension(source, dir, ext)
|
||||
if ext && File.extname(source).empty?
|
||||
if ext && File.extname(source) != ".#{ext}"
|
||||
"#{source}.#{ext}"
|
||||
else
|
||||
source
|
||||
|
||||
@@ -217,6 +217,9 @@ class SprocketsHelperTest < ActionView::TestCase
|
||||
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, :debug => true)
|
||||
|
||||
assert_match %r{<script src="/assets/jquery.plugin.js" type="text/javascript"></script>},
|
||||
javascript_include_tag('jquery.plugin', :digest => false)
|
||||
|
||||
@config.assets.compile = true
|
||||
@config.assets.debug = true
|
||||
assert_match %r{<script src="/javascripts/application.js" type="text/javascript"></script>},
|
||||
|
||||
Reference in New Issue
Block a user