Created
September 24, 2012 19:42
-
-
Save paul/3777893 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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