Add a test case for relative asset handling.

This commit is contained in:
Chris Eppstein 2009-11-21 13:29:16 -08:00
parent 382388b029
commit f7aa26c58e
9 changed files with 37 additions and 1 deletions

View File

@ -9,7 +9,7 @@ class CompassTest < Test::Unit::TestCase
end end
def teardown def teardown
teardown_fixtures :blueprint, :empty, :compass, :image_urls teardown_fixtures :blueprint, :empty, :compass, :image_urls, :relative
end end
def teardown_fixtures(*project_names) def teardown_fixtures(*project_names)
@ -55,6 +55,15 @@ class CompassTest < Test::Unit::TestCase
end end
end end
def test_image_urls
within_project('relative') do |proj|
each_css_file(proj.css_path) do |css_file|
assert_no_errors css_file, 'relative'
end
assert_renders_correctly :screen
end
end
private private
def assert_no_errors(css_file, project_name) def assert_no_errors(css_file, project_name)
file = css_file[(tempfile_path(project_name).size+1)..-1] file = css_file[(tempfile_path(project_name).size+1)..-1]

View File

@ -0,0 +1,9 @@
# Require any additional compass plugins here.
css_dir = "tmp"
sass_dir = "sass"
images_dir = "assets/images"
javascripts_dir = "assets/javascripts"
# Set this to the root of your project when deployed:
http_path = "/"
# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true

View File

@ -0,0 +1 @@
/* Welcome to Compass. Use this file to write IE specific override styles. Import this file using the following HTML or equivalent: <!--[if IE]> <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" /> <![endif]--> */

View File

@ -0,0 +1 @@
/* Welcome to Compass. Use this file to define print styles. Import this file using the following HTML or equivalent: <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> */

View File

@ -0,0 +1 @@
test { background: url('../assets/images/testing.png?1258702388'); }

View File

@ -0,0 +1,6 @@
/*
Welcome to Compass. Use this file to write IE specific override styles.
Import this file using the following HTML or equivalent:
<!--[if IE]>
<link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
<![endif]-->

View File

@ -0,0 +1,6 @@
/*
Welcome to Compass. Use this file to define print styles.
Import this file using the following HTML or equivalent:
<link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" />

View File

@ -0,0 +1,3 @@
test
background= image_url("testing.png")