Skip to content

Commit

Permalink
Merge pull request jasmine#79 from dburkes/master
Browse files Browse the repository at this point in the history
Push no-cache headers on every response
  • Loading branch information
ragaskar committed Feb 24, 2012
2 parents 3ee4624 + a5b433d commit 34c1529
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/jasmine/server.rb
Expand Up @@ -74,6 +74,7 @@ def call(env)
def self.app(config)
Rack::Builder.app do
use Rack::Head
use Rack::ETag, "max-age=0, private, must-revalidate"
if Jasmine::Dependencies.rails_3_asset_pipeline?
map('/assets') do
run Rails.application.assets
Expand Down
6 changes: 6 additions & 0 deletions spec/server_spec.rb
Expand Up @@ -15,6 +15,12 @@ def app
Jasmine.app(config)
end

it "includes no-cache headers for specs" do
get "/__spec__/example_spec.js"
last_response.headers.should have_key("Cache-Control")
last_response.headers["Cache-Control"].should == "max-age=0, private, must-revalidate"
end

it "should serve static files from spec dir under __spec__" do
get "/__spec__/example_spec.js"
last_response.status.should == 200
Expand Down

0 comments on commit 34c1529

Please sign in to comment.