Sha256: 84504aad4ee46470e39bb3ac887bf1eba65777e46ac386662b0ab731eda45083

Contents?: true

Size: 901 Bytes

Versions: 13

Compression:

Stored size: 901 Bytes

Contents

require 'spec_helper'

RSpec.describe CanvasSync::Jobs::ReportStarter do
  let(:report_params) { { 'parameters[users]' => true } }
  let(:report_name) { 'provisioning_csv' }
  let(:processor) { 'CoolProcessor' }

  describe '#perform' do
    it 'tells Canvas to start the report and then enqueues a ReportChecker with the report id' do
      expect_any_instance_of(Bearcat::Client).to receive(:start_report)
        .with('self', report_name, report_params)
        .and_return({ 'id' => 1 })

      expect(CanvasSync::Jobs::ReportChecker).to receive(:set).and_call_original

      CanvasSync::Jobs::ReportStarter.perform_now(
                                { jobs: [], global_options: {} },
                                report_name,
                                report_params,
                                processor,
                                { models: ['users'] })
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
canvas_sync-0.3.8 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.3.7 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.3.6 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.3.5 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.3.3 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.3.2 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.3.1 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.3.0 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.2.4 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.2.3 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.2.2 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.2.1 spec/canvas_sync/jobs/report_starter_spec.rb
canvas_sync-0.2.0 spec/canvas_sync/jobs/report_starter_spec.rb