2019-04-11 12:17:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-16 18:26:22 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 15:08:50 +00:00
|
|
|
RSpec.describe Keys::DestroyService do
|
2018-05-16 18:26:22 +00:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
subject { described_class.new(user) }
|
|
|
|
|
|
|
|
it 'destroys a key' do
|
2021-07-09 09:09:53 +00:00
|
|
|
key = create(:personal_key)
|
2018-05-16 18:26:22 +00:00
|
|
|
|
|
|
|
expect { subject.execute(key) }.to change(Key, :count).by(-1)
|
|
|
|
end
|
|
|
|
end
|