Specs for ETag headers for binary files
This commit is contained in:
parent
5215cdc5e0
commit
b907f02f37
@ -108,7 +108,7 @@ module RemoteStorage
|
||||
new_object_size = object.raw_data.size
|
||||
end
|
||||
|
||||
response = object.store
|
||||
object.store
|
||||
|
||||
log_count = object_exists ? 0 : 1
|
||||
log_operation(user, directory, log_count, new_object_size, existing_object_size)
|
||||
|
||||
@ -369,13 +369,23 @@ describe "App with Riak backend" do
|
||||
last_response.body.must_equal @image
|
||||
end
|
||||
|
||||
# it "indexes the binary set" do
|
||||
# indexes = binary_bucket.get("jimmy:documents:jaypeg").indexes
|
||||
# indexes["user_id_bin"].must_be_kind_of Set
|
||||
# indexes["user_id_bin"].must_include "jimmy"
|
||||
it "responds with an ETag header" do
|
||||
last_response.headers["ETag"].wont_be_nil
|
||||
etag = last_response.headers["ETag"]
|
||||
|
||||
# indexes["directory_bin"].must_include "documents"
|
||||
# end
|
||||
get "/jimmy/documents/jaypeg"
|
||||
|
||||
last_response.headers["ETag"].wont_be_nil
|
||||
last_response.headers["ETag"].must_equal etag
|
||||
end
|
||||
|
||||
it "changes the ETag when updating the file" do
|
||||
old_etag = last_response.headers["ETag"]
|
||||
put "/jimmy/documents/jaypeg", @image
|
||||
|
||||
last_response.headers["ETag"].wont_be_nil
|
||||
last_response.headers["ETag"].wont_equal old_etag
|
||||
end
|
||||
|
||||
it "logs the operation" do
|
||||
objects = []
|
||||
@ -409,14 +419,6 @@ describe "App with Riak backend" do
|
||||
last_response.status.must_equal 200
|
||||
last_response.body.must_equal @image
|
||||
end
|
||||
|
||||
# it "indexes the binary set" do
|
||||
# indexes = binary_bucket.get("jimmy:documents:jaypeg").indexes
|
||||
# indexes["user_id_bin"].must_be_kind_of Set
|
||||
# indexes["user_id_bin"].must_include "jimmy"
|
||||
|
||||
# indexes["directory_bin"].must_include "documents"
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user