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:
authorRémy Coutable <remy@rymai.me>2018-05-16 21:26:22 +0300
committerRémy Coutable <remy@rymai.me>2018-05-16 21:26:22 +0300
commit6d81905fafb23f20520eb5ffa46c94b18ccc8686 (patch)
treee265085fa9378a96ddcbae0d51e3f3cdb3de5b8e /spec/services/keys/destroy_service_spec.rb
parentc75ae23729771869591b6bc4f1528581d3bfe999 (diff)
Introduce a new Keys::DestroyService service
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/services/keys/destroy_service_spec.rb')
-rw-r--r--spec/services/keys/destroy_service_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/services/keys/destroy_service_spec.rb b/spec/services/keys/destroy_service_spec.rb
new file mode 100644
index 00000000000..28ac72ddd42
--- /dev/null
+++ b/spec/services/keys/destroy_service_spec.rb
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe Keys::DestroyService do
+ let(:user) { create(:user) }
+
+ subject { described_class.new(user) }
+
+ it 'destroys a key' do
+ key = create(:key)
+
+ expect { subject.execute(key) }.to change(Key, :count).by(-1)
+ end
+end