From 9279d1102c7d96810813cad0d0a666db0a549b1f Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Sun, 11 Sep 2011 01:38:55 -0500 Subject: Set relative url root in assets when controller isn't available for Sprockets. Fix #2435 See https://github.com/rails/sass-rails/issues/42 for details --- actionpack/test/template/sprockets_helper_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index ae4cb1f0aa..105c641712 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -124,6 +124,13 @@ class SprocketsHelperTest < ActionView::TestCase asset_path("/images/logo.gif") end + test "asset path with relative url root when controller isn't present but relative_url_root is" do + @controller = nil + @config.action_controller.relative_url_root = "/collaboration/hieraki" + assert_equal "/collaboration/hieraki/images/logo.gif", + asset_path("/images/logo.gif") + end + test "javascript path" do assert_match %r{/assets/application-[0-9a-f]+.js}, asset_path(:application, "js") -- cgit v1.2.3