Skip to content
Browse files

Added test for no-rewrite-relative-paths.

  • Loading branch information...
1 parent 287bc4d commit cea2b4e34213b547dd0480e33aa7bfbd04fde1e4 @dblock committed
View
13 test/config/assets-no-rewrite-relative-paths.yml
@@ -0,0 +1,13 @@
+javascript_compressor: yui
+embed_assets: on
+rewrite_relative_paths: off
+
+javascripts:
+ js_test:
+ - fixtures/src/*.js
+ jst_test:
+ - fixtures/src/*.jst
+
+stylesheets:
+ css_test:
+ - fixtures/src/*.css
View
1 test/fixtures/jammed/css_test-no-rewrite-relative-paths.css
@@ -0,0 +1 @@
+#hello{color:white;background:blue}#hello .world{border:1px solid red;margin-left:10px;margin-right:10px;margin-bottom:45px;margin-top:45px}#another{color:white;background:blue}#css .file{border:1px solid red;margin-left:10px;margin-right:10px;margin-bottom:45px;margin-top:45px}#with_images{background:url(../../public/embed/asterisk_yellow.png?101)}#and_relative_paths{background:url(../../public/embed/asterisk_orange.png?101)}#and_real_urls{background:url(http://example.com/image.png)}@font-face{font-family:'DroidSansMonoRegular';src:url(../../public/embed/DroidSansMono.eot?101);src:local('Droid Sans Mono Regular'),local('DroidSansMono'),url(../../public/embed/DroidSansMono.ttf?101) format('truetype')}
View
7 test/unit/test_configuration.rb
@@ -72,4 +72,11 @@ def test_environment_specific_configuration
ENV['RAILS_ENV'] = 'test'
end
+ def test_no_rewrite_relative_paths
+ Jammit.load_configuration('test/config/assets-no-rewrite-relative-paths.yml')
+ assert !Jammit.rewrite_relative_paths
+ packed = @compressor.compress_css(glob('test/fixtures/src/*.css'))
+ assert_equal packed, File.read('test/fixtures/jammed/css_test-no-rewrite-relative-paths.css')
+ end
+
end

0 comments on commit cea2b4e

Please sign in to comment.
Something went wrong with that request. Please try again.