Add a test case for relative asset handling.
This commit is contained in:
parent
382388b029
commit
f7aa26c58e
@ -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]
|
||||||
|
0
test/fixtures/stylesheets/relative/assets/images/testing.png
vendored
Normal file
0
test/fixtures/stylesheets/relative/assets/images/testing.png
vendored
Normal file
9
test/fixtures/stylesheets/relative/config.rb
vendored
Normal file
9
test/fixtures/stylesheets/relative/config.rb
vendored
Normal 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
|
1
test/fixtures/stylesheets/relative/css/ie.css
vendored
Normal file
1
test/fixtures/stylesheets/relative/css/ie.css
vendored
Normal 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]--> */
|
1
test/fixtures/stylesheets/relative/css/print.css
vendored
Normal file
1
test/fixtures/stylesheets/relative/css/print.css
vendored
Normal 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" /> */
|
1
test/fixtures/stylesheets/relative/css/screen.css
vendored
Normal file
1
test/fixtures/stylesheets/relative/css/screen.css
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
test { background: url('../assets/images/testing.png?1258702388'); }
|
6
test/fixtures/stylesheets/relative/sass/ie.sass
vendored
Normal file
6
test/fixtures/stylesheets/relative/sass/ie.sass
vendored
Normal 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]-->
|
6
test/fixtures/stylesheets/relative/sass/print.sass
vendored
Normal file
6
test/fixtures/stylesheets/relative/sass/print.sass
vendored
Normal 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" />
|
||||||
|
|
||||||
|
|
3
test/fixtures/stylesheets/relative/sass/screen.sass
vendored
Normal file
3
test/fixtures/stylesheets/relative/sass/screen.sass
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
test
|
||||||
|
background= image_url("testing.png")
|
Loading…
Reference in New Issue
Block a user