From be21ef316b12e53fdb1568bbe9fe94a8fabb4c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 16 Nov 2015 17:11:08 +0100 Subject: [PATCH] Delete new file added in ec6e5d73e87a86c27626153b986158f591699254 --- api_spec.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/api_spec.rb b/api_spec.rb index 5102589..ecbf9c0 100644 --- a/api_spec.rb +++ b/api_spec.rb @@ -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 @@ -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 @@ -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