Sha256: 21c1570385bf2237079f697347585ae22226d72d561d2013b238a6ea059173c3

Contents?: true

Size: 846 Bytes

Versions: 32

Compression:

Stored size: 846 Bytes

Contents

require 'spec_helper'

class FakeProcessor; end;

RSpec.describe CanvasSync::Jobs::ReportProcessorJob do
  let(:report_name) { 'provisioning_csv' }
  let(:report_url) { 'https://test.instructure.com/sample_report_download' }
  let(:processor) { FakeProcessor.to_s }
  let(:job_chain) { { jobs: [], global_options: {} } }
  let(:report_id) { 1 }

  describe '#perform' do
    it 'downloads the report to a file and then calls the process method on the processor, and then invokes the next job' do
      expect(IO).to receive(:copy_stream)
      expect(FakeProcessor).to receive(:process)
      expect(CanvasSync).to receive(:invoke_next).with(job_chain)

      CanvasSync::Jobs::ReportProcessorJob.perform_now(
        job_chain,
        report_name,
        report_url,
        processor,
        {},
        report_id,
      )
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
canvas_sync-0.11.1 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.16.5 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.16.4 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.16.3 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.16.2 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.16.1 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.15.1 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.15.0 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.14.0 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.13.0 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.12.0 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.11.0 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.10.6 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.10.5 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.10.4 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.10.3 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.10.2 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.10.0 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.9.4 spec/canvas_sync/jobs/report_processor_job_spec.rb
canvas_sync-0.9.3 spec/canvas_sync/jobs/report_processor_job_spec.rb