import_job_backend_examples.rb 770 B

123456789101112131415161718192021222324252627282930
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. RSpec.shared_examples 'ImportJob backend' do
  3. it 'responds to .queueable?' do
  4. expect(described_class).to respond_to(:queueable?)
  5. end
  6. it 'requires an import job instance as parameter' do
  7. expect do
  8. described_class.new
  9. end.to raise_error(ArgumentError)
  10. import_job = create(:import_job)
  11. expect do
  12. described_class.new(import_job)
  13. end.not_to raise_error
  14. end
  15. it 'responds to #start' do
  16. import_job = create(:import_job)
  17. expect(described_class.new(import_job)).to respond_to(:start)
  18. end
  19. it 'responds to #reschedule?' do
  20. import_job = create(:import_job)
  21. expect(described_class.new(import_job)).to respond_to(:reschedule?)
  22. end
  23. end