2009-11-17 20:38:10 +01:00
|
|
|
require File.join(File.dirname(__FILE__), "spec_helper")
|
|
|
|
|
|
|
|
describe "Cache Buster Feature in CSS" do
|
2009-11-18 00:52:28 +01:00
|
|
|
before do
|
|
|
|
base = ::Middleman::Base
|
|
|
|
base.set :root, File.join(File.dirname(__FILE__), "fixtures", "sample")
|
|
|
|
base.enable :cache_buster
|
|
|
|
@browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
|
2009-11-17 20:38:10 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
it "should append query string in CSS if on" do
|
2009-11-18 00:52:28 +01:00
|
|
|
@browser.get("/stylesheets/relative_assets.css")
|
|
|
|
@browser.last_response.body.should include("?")
|
2009-11-17 20:38:10 +01:00
|
|
|
end
|
|
|
|
|
2009-11-17 21:24:10 +01:00
|
|
|
it "should not append query string in HTML if on IN DEVELOPMENT" do
|
2009-11-18 00:52:28 +01:00
|
|
|
@browser.get("/cache-buster.html")
|
|
|
|
@browser.last_response.body.count("?").should == 0
|
2009-11-17 20:38:10 +01:00
|
|
|
end
|
|
|
|
end
|