spec/sprockets-sass_spec.rb in sprockets-sass-0.5.0 vs spec/sprockets-sass_spec.rb in sprockets-sass-0.5.1

- old
+ new

@@ -205,16 +205,25 @@ @env["image_url.css"].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n) @env["image_path_options.css"].to_s.should =~ %r(body \{\n background: url\("/themes/image-[0-9a-f]+.jpg"\); \}\n) @env["image_url_options.css"].to_s.should =~ %r(body \{\n background: url\("/themes/image-[0-9a-f]+.jpg"\); \}\n) end - it "doesn't break Compass's #image_url helper" do + it "mirrors Compass's #image_url helper" do @assets.file "image_path.css.scss", %(body { background: url(image-url("image.jpg", true)); }) @assets.file "image_url.css.scss", %(body { background: image-url("image.jpg", false); }) @assets.file "cache_buster.css.scss", %(body { background: image-url("image.jpg", false, true); }) @assets.file "image.jpg" @env["image_path.css"].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n) @env["image_url.css"].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n) @env["cache_buster.css"].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n) + end + + it "mirrors Sass::Rails's #asset_path helpers" do + @assets.file "asset_path.css.scss", %(body { background: url(asset-path("image.jpg", image)); }) + @assets.file "asset_url.css.scss", %(body { background: asset-url("icon.jpg", image); }) + @assets.file "image.jpg" + + @env["asset_path.css"].to_s.should == %(body {\n background: url("/assets/image.jpg"); }\n) + @env["asset_url.css"].to_s.should == %(body {\n background: url("/images/icon.jpg"); }\n) end end