Skip to content
This repository
Browse code

javascript_include_tag should add '.js' to sources that contain '.'

  • Loading branch information...
commit aa491f6a9c90641a2d4115420b14e45514962834 1 parent 8cae31c
Sergey Nartimov authored
2  actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -154,7 +154,7 @@ def rewrite_asset_path(source, dir, options = {})
154 154
         end
155 155
 
156 156
         def rewrite_extension(source, dir, ext)
157  
-          if ext && File.extname(source).empty?
  157
+          if ext && File.extname(source) != ".#{ext}"
158 158
             "#{source}.#{ext}"
159 159
           else
160 160
             source
3  actionpack/test/template/sprockets_helper_test.rb
@@ -217,6 +217,9 @@ def config
217 217
     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>},
218 218
       javascript_include_tag(:application, :debug => true)
219 219
 
  220
+    assert_match %r{<script src="/assets/jquery.plugin.js" type="text/javascript"></script>},
  221
+      javascript_include_tag('jquery.plugin', :digest => false)
  222
+
220 223
     @config.assets.compile = true
221 224
     @config.assets.debug = true
222 225
     assert_match %r{<script src="/javascripts/application.js" type="text/javascript"></script>},

0 notes on commit aa491f6

Please sign in to comment.
Something went wrong with that request. Please try again.