Skip to content

Instantly share code, notes, and snippets.

@paul
Created September 24, 2012 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paul/3777893 to your computer and use it in GitHub Desktop.
Save paul/3777893 to your computer and use it in GitHub Desktop.
personal/hypercacher - [master] » rspec spec/acceptance/response_cache_control_spec.rb
Hypercacher response Cache-Control header
is not present
the first request
should be OK (code 200)
should be authoritative
the second request
should be OK (code 200)
should not be authoritative
the remote server
should have received 1 request
Finished in 0.02721 seconds
5 examples, 0 failures
require 'spec_helper'
describe Hypercacher, "response Cache-Control header" do
context "is not present" do
app do
get "/cache-control/none" do
"<h1>No Cache-Control set</h1>"
end
end
request do
get "/cache-control/none"
end
subject { response }
describe "the first request" do
before { make_request }
it { should be_ok }
it { should be_authoritative }
end
describe "the second request" do
before do
2.times { make_request }
end
it { should be_ok }
it { should_not be_authoritative }
describe "the remote server" do
subject { app }
it { should have_received(1).request }
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment