From c9145a4aca4096d5c88698872b7002b10c684deb Mon Sep 17 00:00:00 2001 From: Noah Kantrowitz Date: Thu, 30 Jun 2011 18:44:19 -0700 Subject: [PATCH] Add a test for the new sprite offset passing. --- test/integrations/sprites_test.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/integrations/sprites_test.rb b/test/integrations/sprites_test.rb index 6f6834bd..99a7d63e 100644 --- a/test/integrations/sprites_test.rb +++ b/test/integrations/sprites_test.rb @@ -518,6 +518,33 @@ class SpritesTest < Test::Unit::TestCase } CSS end + + it "should render corret sprite with css selectors via magic mixin with the correct offsets" do + css = render <<-SCSS + @import "selectors/*.png"; + a { + @include selectors-sprite(ten-by-ten, false, 5, -5) + } + SCSS + assert_correct css, <<-CSS + .selectors-sprite, a { + background: url('/selectors-sedfef809e2.png') no-repeat; + } + + a { + background-position: 5px -5px; + } + a:hover, a.ten-by-ten_hover, a.ten-by-ten-hover { + background-position: 5px -25px; + } + a:target, a.ten-by-ten_target, a.ten-by-ten-target { + background-position: 5px -35px; + } + a:active, a.ten-by-ten_active, a.ten-by-ten-active { + background-position: 5px -15px; + } + CSS + end it "should raise error on filenames that are not valid sass syntax" do assert_raise(Compass::Error) do