Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (21 sloc) 0.746 kb
require 'test_helper'
class CssRewriterTest < Test::Unit::TestCase
context "The CssRewriter" do
setup do
CloudfrontAssetHost.configure do |config|
config.cname = "assethost.com"
config.bucket = "bucketname"
config.key_prefix = ""
config.enabled = false
end
@stylesheet_path = File.join(Rails.public_path, 'stylesheets', 'style.css')
end
should "rewrite a single css file" do
tmp = CloudfrontAssetHost::CssRewriter.rewrite_stylesheet(@stylesheet_path)
contents = File.read(tmp.path)
contents.split("\n").each do |line|
assert_equal "body { background-image: url(http://assethost.com/d41d8cd98/images/image.png); }", line
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.