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( [], report_name, report_params, processor, { models: ['users'] }) end end end