From fd8f0b297822ba36002084faa36bd0320d3be4a7 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 5 Oct 2011 15:41:28 -0200 Subject: stylesheet_link_tag('/stylesheets/application') and similar helpers doesn't throw Sprockets::FileOutsidePaths exception anymore --- actionpack/lib/sprockets/helpers/rails_helper.rb | 2 ++ actionpack/test/template/sprockets_helper_test.rb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb index f866bc626e..ddf9b08b54 100644 --- a/actionpack/lib/sprockets/helpers/rails_helper.rb +++ b/actionpack/lib/sprockets/helpers/rails_helper.rb @@ -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) diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index 08b66fec8b..db69f95130 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -219,6 +219,8 @@ class SprocketsHelperTest < ActionView::TestCase @config.assets.compile = true @config.assets.debug = true + assert_match %r{}, + javascript_include_tag('/javascripts/application') assert_match %r{\n}, javascript_include_tag(:application) end @@ -264,6 +266,9 @@ class SprocketsHelperTest < ActionView::TestCase @config.assets.compile = true @config.assets.debug = true + assert_match %r{}, + stylesheet_link_tag('/stylesheets/application') + assert_match %r{\n}, stylesheet_link_tag(:application) -- cgit v1.2.3