From 5409e745e92827833ab4139ede931cd991ea1290 Mon Sep 17 00:00:00 2001 From: tonyschneider Date: Sun, 2 Apr 2023 18:35:38 +0300 Subject: [PATCH] delete snapshot api test --- spec/requests/cloud_volume_snapshots_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/requests/cloud_volume_snapshots_spec.rb b/spec/requests/cloud_volume_snapshots_spec.rb index df41f17f0a..7b0075ce33 100644 --- a/spec/requests/cloud_volume_snapshots_spec.rb +++ b/spec/requests/cloud_volume_snapshots_spec.rb @@ -77,5 +77,16 @@ expect_bad_request(/Feature not .*supported/) end end + + describe "DELETE /api/cloud_volumes/:c_id/cloud_volume_snapshots/:s_id" do + it "create & delete cloud volume snapshot" do + api_basic_authorize('cloud_volume_snapshot_delete') + + stub_supports(CloudVolumeSnapshot, :delete) + post(api_cloud_volume_snapshot_url(nil, cloud_volume_snapshot), :params => gen_request(:delete)) + + expect_single_action_result(:success => true, :message => /Deleting Cloud Volume Snapshot id: #{cloud_volume_snapshot.id} name: '#{cloud_volume_snapshot.name}'/) + end + end end end