Permalink
Browse files

stylesheet_link_tag('/stylesheets/application') and similar helpers d…

…oesn't throw Sprockets::FileOutsidePaths exception anymore
  • Loading branch information...
1 parent c495bfc commit fd8f0b297822ba36002084faa36bd0320d3be4a7 @spastorino spastorino committed Oct 5, 2011
@@ -123,6 +123,8 @@ def asset_for(source, ext)
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 @@ def config
@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 @@ def config
@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)

1 comment on commit fd8f0b2

@avakhov
Contributor
avakhov commented on fd8f0b2 Oct 9, 2011

Thank you! I migrated my projects from 3.0.10 to 3.1.1 successfully.

Please sign in to comment.