debian-mirror-gitlab/spec/services/keys/destroy_service_spec.rb

16 lines
343 B
Ruby
Raw Normal View History

2019-07-31 22:56:46 +05:30
# frozen_string_literal: true
2018-11-08 19:23:39 +05:30
require 'spec_helper'
2023-05-27 22:25:52 +05:30
RSpec.describe Keys::DestroyService, feature_category: :source_code_management do
2018-11-08 19:23:39 +05:30
let(:user) { create(:user) }
subject { described_class.new(user) }
it 'destroys a key' do
2021-09-30 23:02:18 +05:30
key = create(:personal_key)
2018-11-08 19:23:39 +05:30
expect { subject.execute(key) }.to change(Key, :count).by(-1)
end
end