Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Pass extensions to javascript_path and stylesheet_path helpers. Closes

  • Loading branch information...
commit b7c7f08c87a848d28a2d0b515a6d51b0e141deed 1 parent 6d5a27a
@spastorino spastorino authored
View
4 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -64,12 +64,12 @@ def image_path(source)
alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route
def javascript_path(source)
- path_to_asset(source)
+ path_to_asset(source, :ext => 'js')
end
alias_method :path_to_javascript, :javascript_path # aliased to avoid conflicts with an javascript_path named route
def stylesheet_path(source)
- path_to_asset(source)
+ path_to_asset(source, :ext => 'css')
end
alias_method :path_to_stylesheet, :stylesheet_path # aliased to avoid conflicts with an stylesheet_path named route
View
6 actionpack/test/template/sprockets_helper_test.rb
@@ -144,6 +144,9 @@ def config
test "javascript_path" do
assert_match %r{/assets/application-[0-9a-f]+.js},
+ javascript_path("application")
+
+ assert_match %r{/assets/application-[0-9a-f]+.js},
javascript_path("application.js")
assert_match %r{/assets/application-[0-9a-f]+.js},
@@ -152,6 +155,9 @@ def config
test "stylesheet_path" do
assert_match %r{/assets/application-[0-9a-f]+.css},
+ stylesheet_path("application")
+
+ assert_match %r{/assets/application-[0-9a-f]+.css},
stylesheet_path("application.css")
assert_match %r{/assets/application-[0-9a-f]+.css},
Please sign in to comment.
Something went wrong with that request. Please try again.