Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/gpg_keys/destroy_service_spec.rb')
-rw-r--r--spec/services/gpg_keys/destroy_service_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/gpg_keys/destroy_service_spec.rb b/spec/services/gpg_keys/destroy_service_spec.rb
new file mode 100644
index 00000000000..b9aa3e351c9
--- /dev/null
+++ b/spec/services/gpg_keys/destroy_service_spec.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe GpgKeys::DestroyService do
+ let(:user) { create(:user) }
+
+ subject { described_class.new(user) }
+
+ it 'destroys the GPG key' do
+ gpg_key = create(:gpg_key)
+
+ expect { subject.execute(gpg_key) }.to change(GpgKey, :count).by(-1)
+ end
+end