summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-05-16 20:26:22 +0200
committerRémy Coutable <remy@rymai.me>2018-05-16 20:26:22 +0200
commit6d81905fafb23f20520eb5ffa46c94b18ccc8686 (patch)
treee265085fa9378a96ddcbae0d51e3f3cdb3de5b8e /spec/services
parentc75ae23729771869591b6bc4f1528581d3bfe999 (diff)
downloadgitlab-ce-6d81905fafb23f20520eb5ffa46c94b18ccc8686.tar.gz
Introduce a new Keys::DestroyService service
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/services')
-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