2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Keys::DestroyService do
|
2018-11-08 19:23:39 +05:30
|
|
|
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
|