Permalink
Browse files

Add tests for alternate asset prefix/environment

(cherry picked from commit 0613f3b)
  • Loading branch information...
1 parent b8fa5f6 commit add63ee220f0721a0be24a9a45ef9482f3991640 @spohlenz spohlenz committed Jul 1, 2011
@@ -0,0 +1 @@
+/* Different from other style.css */
@@ -199,4 +199,16 @@ def url_for(*args)
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

0 comments on commit add63ee

Please sign in to comment.