If-None-Match header may contain multiple revisions
This commit is contained in:
@@ -129,6 +129,31 @@ describe "Directories" do
|
||||
end
|
||||
end
|
||||
|
||||
describe "when If-None-Match header is set with multiple revisions" do
|
||||
before do
|
||||
get "/jimmy/tasks/"
|
||||
|
||||
@etag = last_response.headers["ETag"]
|
||||
end
|
||||
|
||||
it "responds with 'not modified' when it contains the current ETag" do
|
||||
header "If-None-Match", "DEADBEEF,#{@etag} ,F00BA4"
|
||||
get "/jimmy/tasks/"
|
||||
|
||||
last_response.status.must_equal 304
|
||||
last_response.body.must_be_empty
|
||||
last_response.headers["ETag"].must_equal @etag
|
||||
end
|
||||
|
||||
it "responds normally when it does not contain the current ETag" do
|
||||
header "If-None-Match", "FOO,BAR"
|
||||
get "/jimmy/tasks/"
|
||||
|
||||
last_response.status.must_equal 200
|
||||
last_response.body.wont_be_empty
|
||||
end
|
||||
end
|
||||
|
||||
context "with sub-directories" do
|
||||
before do
|
||||
get "/jimmy/tasks/"
|
||||
|
||||
@@ -156,6 +156,25 @@ describe "App with Riak backend" do
|
||||
last_response.body.must_equal "some private text data"
|
||||
end
|
||||
end
|
||||
|
||||
describe "when If-None-Match header is set with multiple revisions" do
|
||||
it "responds with 'not modified' when it contains the current ETag" do
|
||||
header "If-None-Match", "DEADBEEF,#{@etag},F00BA4"
|
||||
get "/jimmy/documents/foo"
|
||||
|
||||
last_response.status.must_equal 304
|
||||
last_response.body.must_be_empty
|
||||
last_response.headers["ETag"].must_equal @etag
|
||||
end
|
||||
|
||||
it "responds normally when it does not contain the current ETag" do
|
||||
header "If-None-Match", "FOO,BAR"
|
||||
get "/jimmy/documents/foo"
|
||||
|
||||
last_response.status.must_equal 200
|
||||
last_response.body.must_equal "some private text data"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET nonexisting key" do
|
||||
|
||||
Reference in New Issue
Block a user