Skip to content

Commit

Permalink
Delete new file added in ec6e5d7
Browse files Browse the repository at this point in the history
  • Loading branch information
gregkare authored and untitaker committed Nov 16, 2015
1 parent 8461a3d commit be21ef3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,18 @@ def check_dir_listing_content_type(content_type)
before do
@old_outer_listing_res = do_get_request("#{CONFIG[:category]}/")
@old_listing_res = do_get_request("#{CONFIG[:category]}/some-other-subdir/")
old_listing = JSON.parse @old_listing_res.body
@old_item_info = old_listing["items"]["test-object-simple.json"]

@res = do_put_request("#{CONFIG[:category]}/some-other-subdir/test-object-simple.json",
'{"new": "object"}',
{ content_type: "application/json" })
@item_etag = @res.headers[:etag]

@outer_listing_res = do_get_request("#{CONFIG[:category]}/")
@listing_res = do_get_request("#{CONFIG[:category]}/some-other-subdir/")

@item_etag = @res.headers[:etag]
@old_listing = JSON.parse @old_listing_res.body
@listing = JSON.parse @listing_res.body
@item_info = @listing["items"]["test-object-simple.json"]
@old_item_info = @old_listing["items"]["test-object-simple.json"]
listing = JSON.parse @listing_res.body
@item_info = listing["items"]["test-object-simple.json"]
end

it "works" do
Expand All @@ -110,7 +111,7 @@ def check_dir_listing_content_type(content_type)
end

it "updates the folder etag" do
@listing_res.headers[:etag].wont_equal @old_outer_listing_res.headers[:etag]
@listing_res.headers[:etag].wont_equal @old_listing_res.headers[:etag]
@outer_listing_res.headers[:etag].wont_equal @old_outer_listing_res.headers[:etag]
end
end
Expand Down Expand Up @@ -624,8 +625,9 @@ def check_dir_listing_content_type(content_type)

describe "DELETE objects" do
it "works" do
[ "test-object-simple.json", "Capture d'écran.jpg",
"some-subdir/nested-folder-object.json", "my-list" ].each do |key|
[ "test-object-simple.json", "some-other-subdir/test-object-simple.json",
"Capture d'écran.jpg", "some-subdir/nested-folder-object.json",
"my-list" ].each do |key|
res = do_delete_request("#{CONFIG[:category]}/#{key}")

res.code.must_equal 200
Expand Down

0 comments on commit be21ef3

Please # to comment.