Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3092 from asee/master

Sprockets to use config.assets.prefix, with tests
  • Loading branch information...
commit d4f999fba73008a02f0ef8778f86d85fb5225386 1 parent 9eb628a
@spastorino spastorino authored
View
2  actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -57,7 +57,7 @@ def stylesheet_link_tag(*sources)
def asset_path(source, options = {})
source = source.logical_path if source.respond_to?(:logical_path)
- path = asset_paths.compute_public_path(source, 'assets', options.merge(:body => true))
+ path = asset_paths.compute_public_path(source, asset_prefix, options.merge(:body => true))
options[:body] ? "#{path}?body=1" : path
end
View
10 actionpack/test/template/sprockets_helper_test.rb
@@ -50,6 +50,16 @@ def url_for(*args)
asset_path("logo.png", :digest => false)
end
+ test "custom_asset_path" do
+ @config.assets.prefix = '/s'
+ assert_match %r{/s/logo-[0-9a-f]+.png},
+ asset_path("logo.png")
+ assert_match %r{/s/logo-[0-9a-f]+.png},
+ asset_path("logo.png", :digest => true)
+ assert_match %r{/s/logo.png},
+ asset_path("logo.png", :digest => false)
+ end
+
test "asset_path with root relative assets" do
assert_equal "/images/logo",
asset_path("/images/logo")
Please sign in to comment.
Something went wrong with that request. Please try again.