@@ -115,7 +115,6 @@ describe "api", ->
115115
116116 Q .allSettled [
117117 cloudinary .v2 .api .delete_resources_by_tag (TEST_TAG)
118- cloudinary .v2 .api .delete_transformation (NAMED_TRANSFORMATION)
119118 cloudinary .v2 .api .delete_upload_preset (API_TEST_UPLOAD_PRESET1)
120119 cloudinary .v2 .api .delete_upload_preset (API_TEST_UPLOAD_PRESET2)
121120 cloudinary .v2 .api .delete_upload_preset (API_TEST_UPLOAD_PRESET3)
@@ -355,20 +354,20 @@ describe "api", ->
355354 itBehavesLike " a list with a cursor" , cloudinary .v2 .api .transformation , EXPLICIT_TRANSFORMATION_NAME
356355 itBehavesLike " a list with a cursor" , cloudinary .v2 .api .transformations
357356
357+ transformationName = " api_test_transformation3" + SUFFIX
358+ after ->
359+ Q .allSettled [
360+ cloudinary .v2 .api .delete_transformation (transformationName)
361+ cloudinary .v2 .api .delete_transformation (NAMED_TRANSFORMATION)]
362+ .finally ->
363+
358364 it " should allow listing transformations" , () ->
359365 @ timeout helper .TIMEOUT_MEDIUM
360366 cloudinary .v2 .api .transformations ()
361367 .then (result)->
362- transformation = find_by_attr (result .transformations , " name" , EXPLICIT_TRANSFORMATION_NAME)
363- expect (result .next_cursor ).not .to .be .empty ()
364- expect (transformation).not .to .eql (undefined )
365- expect (transformation .used ).to .be .ok ()
366- previous_cursor = result .next_cursor
367- cloudinary .v2 .api .transformations (next_cursor : result .next_cursor )
368- .then (result)-> [previous_cursor, result]
369- .then ([previous_cursor, result])->
370- expect (result).not .to .be .empty ()
371- expect (result .next_cursor ).not .to .eql (previous_cursor)
368+ expect (result).to .have .key (" transformations" )
369+ expect (result .transformations ).not .to .be .empty ()
370+ expect (result .transformations [0 ]).to .have .key (' used' )
372371
373372 it " should allow getting transformation metadata" , () ->
374373 @ timeout helper .TIMEOUT_MEDIUM
@@ -412,7 +411,7 @@ describe "api", ->
412411
413412 it " should allow unsafe update of named transformation" , ()->
414413 @ timeout helper .TIMEOUT_MEDIUM
415- transformationName = " api_test_transformation3 " + SUFFIX
414+
416415 cloudinary .v2 .api .create_transformation (transformationName, {crop : " scale" , width : 102 })
417416 .then (result) ->
418417 cloudinary .v2 .api .update_transformation (transformationName, {unsafe_update : {crop : " scale" , width : 103 }})
@@ -652,7 +651,7 @@ describe "api", ->
652651 new RegExp (" /resources/image/moderations/manual/#{ status2} $" ).test (arg ? .pathname )
653652 , " /resources/image/moderations/manual/#{ status} " )
654653 sinon .assert .calledWith request, sinon .match ( (arg )->
655- / ^ moderations=true$ / . test ( arg ? .query )
654+ " moderations=true" == arg ? .query
656655 , " moderations=true" )
657656
658657 # For this test to work, "Auto-create folders" should be enabled in the Upload Settings.
0 commit comments