mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 01:31:39 -05:00
20 lines
521 B
Ruby
20 lines
521 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe Imports::Destroy do
|
|
describe '#call' do
|
|
let!(:user) { create(:user) }
|
|
let!(:import) { create(:import, user: user) }
|
|
let(:service) { described_class.new(user, import) }
|
|
|
|
it 'destroys the import' do
|
|
expect { service.call }.to change { Import.count }.by(-1)
|
|
end
|
|
|
|
it 'enqueues a BulkStatsCalculatingJob' do
|
|
expect(BulkStatsCalculatingJob).to receive(:perform_later).with(user.id)
|
|
service.call
|
|
end
|
|
end
|
|
end
|