Skip to content

Commit 272f8f9

Browse files
author
Amir Tocker
committed
Fix publish API test cleanup
1 parent 8ec55b3 commit 272f8f9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/api_spec.coffee

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,14 +698,16 @@ describe "api", ->
698698

699699
publishTestId = ""
700700
publishTestTag = ""
701+
idsToDelete = []
701702
beforeEach (done)->
702703
publishTestTag = TEST_TAG + suffix()
703-
cloudinary.v2.uploader.upload IMAGE_FILE, public_id: "api_test_publish", type: "authenticated", tags: [TEST_TAG, publishTestTag], (error, result)->
704+
cloudinary.v2.uploader.upload IMAGE_FILE, type: "authenticated", tags: [TEST_TAG, publishTestTag], (error, result)->
704705
return done(new Error error.message) if error?
705706
publishTestId = result.public_id
707+
idsToDelete.push publishTestId
706708
done()
707-
afterEach (done)->
708-
cloudinary.v2.uploader.destroy publishTestId, type: "authenticated", (error, result)->
709+
after (done)->
710+
cloudinary.v2.api.delete_resources idsToDelete, type: "authenticated", (error, result)->
709711
return done(new Error error.message) if error?
710712
done()
711713
it "by public id", (done)->

0 commit comments

Comments
 (0)