mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
stylesheet_link_tag('/stylesheets/application') and similar helpers doesn't throw Sprockets::FileOutsidePaths exception anymore
This commit is contained in:
parent
c495bfc127
commit
fd8f0b2978
2 changed files with 7 additions and 0 deletions
|
@ -123,6 +123,8 @@ module Sprockets
|
|||
return nil if is_uri?(source)
|
||||
source = rewrite_extension(source, nil, ext)
|
||||
asset_environment[source]
|
||||
rescue Sprockets::FileOutsidePaths
|
||||
nil
|
||||
end
|
||||
|
||||
def digest_for(logical_path)
|
||||
|
|
|
@ -219,6 +219,8 @@ class SprocketsHelperTest < ActionView::TestCase
|
|||
|
||||
@config.assets.compile = true
|
||||
@config.assets.debug = true
|
||||
assert_match %r{<script src="/javascripts/application.js" type="text/javascript"></script>},
|
||||
javascript_include_tag('/javascripts/application')
|
||||
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)
|
||||
end
|
||||
|
@ -264,6 +266,9 @@ class SprocketsHelperTest < ActionView::TestCase
|
|||
|
||||
@config.assets.compile = true
|
||||
@config.assets.debug = true
|
||||
assert_match %r{<link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />},
|
||||
stylesheet_link_tag('/stylesheets/application')
|
||||
|
||||
assert_match %r{<link href="/assets/style-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />\n<link href="/assets/application-[0-9a-f]+.css\?body=1" media="screen" rel="stylesheet" type="text/css" />},
|
||||
stylesheet_link_tag(:application)
|
||||
|
||||
|
|
Loading…
Reference in a new issue