2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2017-05-05 08:58:05 +00:00
|
|
|
RSpec.shared_examples 'ImportJob backend' do
|
|
|
|
|
2017-05-11 15:18:03 +00:00
|
|
|
it 'responds to .queueable?' do
|
2017-05-05 08:58:05 +00:00
|
|
|
expect(described_class).to respond_to(:queueable?)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'requires an import job instance as parameter' do
|
|
|
|
|
|
|
|
expect do
|
|
|
|
described_class.new
|
|
|
|
end.to raise_error(ArgumentError)
|
|
|
|
|
|
|
|
import_job = create(:import_job)
|
|
|
|
expect do
|
|
|
|
described_class.new(import_job)
|
|
|
|
end.not_to raise_error
|
|
|
|
end
|
|
|
|
|
2017-05-11 15:18:03 +00:00
|
|
|
it 'responds to #start' do
|
2017-05-05 08:58:05 +00:00
|
|
|
import_job = create(:import_job)
|
|
|
|
expect(described_class.new(import_job)).to respond_to(:start)
|
|
|
|
end
|
2017-05-11 15:18:03 +00:00
|
|
|
|
|
|
|
it 'responds to #reschedule?' do
|
|
|
|
import_job = create(:import_job)
|
|
|
|
expect(described_class.new(import_job)).to respond_to(:reschedule?)
|
|
|
|
end
|
2017-05-05 08:58:05 +00:00
|
|
|
end
|