diff options
author | José Valim <jose.valim@gmail.com> | 2011-07-02 20:23:47 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-07-02 20:23:47 -0700 |
commit | 3875e449abb8b999beca9179a34c6d18fe54feb9 (patch) | |
tree | 093be019abdffcb601b7b183837eaade96f62112 /actionpack/test/template/sprockets_helper_test.rb | |
parent | 9d6e5e64dcd129132c3c565d0b6ead8c9bf45c2f (diff) | |
parent | 21344bc33bb732c9c938881ec13bd7fd44d7e9d8 (diff) | |
download | rails-3875e449abb8b999beca9179a34c6d18fe54feb9.tar.gz rails-3875e449abb8b999beca9179a34c6d18fe54feb9.tar.bz2 rails-3875e449abb8b999beca9179a34c6d18fe54feb9.zip |
Merge pull request #1925 from spohlenz/refactor-asset-paths
Refactor sprockets asset paths to allow for alternate asset environments
Diffstat (limited to 'actionpack/test/template/sprockets_helper_test.rb')
-rw-r--r-- | actionpack/test/template/sprockets_helper_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/template/sprockets_helper_test.rb b/actionpack/test/template/sprockets_helper_test.rb index 6dc9a2a743..f11d1bba15 100644 --- a/actionpack/test/template/sprockets_helper_test.rb +++ b/actionpack/test/template/sprockets_helper_test.rb @@ -197,4 +197,16 @@ class SprocketsHelperTest < ActionView::TestCase assert_equal "<link href=\"/assets/style-d41d8cd98f00b204e9800998ecf8427e.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n<link href=\"/assets/extra-d41d8cd98f00b204e9800998ecf8427e.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />", stylesheet_link_tag("style", "extra") end + + test "alternate asset prefix" do + stubs(:asset_prefix).returns("/themes/test") + assert_equal "/themes/test/style-d41d8cd98f00b204e9800998ecf8427e.css", asset_path("style", "css") + end + + test "alternate asset environment" do + assets = Sprockets::Environment.new + assets.paths << FIXTURES.join("sprockets/alternate/stylesheets") + stubs(:asset_environment).returns(assets) + assert_equal "/assets/style-df0b97ad35a8e1f7f61097461f77c19a.css", asset_path("style", "css") + end end |