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