Permalink
Browse files

Merge pull request #3718 from lest/fix-javascript-include-tag

javascript_include_tag should add '.js' to sources that contain '.'
  • Loading branch information...
2 parents 39ecbfd + aa491f6 commit b13b49ccc17a04836fdc877094eab4c951e69e66 @josevalim josevalim committed Nov 22, 2011
@@ -154,7 +154,7 @@ def rewrite_asset_path(source, dir, options = {})
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 @@ def config
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>},

0 comments on commit b13b49c

Please sign in to comment.