Sha256: 13232e71b916983d3224122463e6e8ade1d7c229d4c1e5620939f480fc132d91
Contents?: true
Size: 1.57 KB
Versions: 7
Compression:
Stored size: 1.57 KB
Contents
require 'spec_helper' RSpec.describe CanvasSync::Jobs::SyncProvisioningReportJob do describe '#perform' do context 'a term scope is specified' do let!(:term) { FactoryBot.create(:term) } it 'enqueues a ReportStarter for a provisioning report for the specified models for each term' do expect_any_instance_of(CanvasSync::Jobs::ReportStarter).to receive(:start_report) .with( 'self', 'proservices_provisioning_csv', { parameters: { include_deleted: true, 'users' => true, 'courses' => true, enrollment_term_id: term.canvas_id, } }, ) set_batch_context(canvas_term_id: term.canvas_id) CanvasSync::Jobs::SyncProvisioningReportJob.perform_now( { models: ['users', 'courses'], term_scope: 'active' } ) end end context 'a term scope is not specified' do it 'enqueues a single ReportStarter for a provisioning report across all terms for the specified models' do expect_any_instance_of(CanvasSync::Jobs::ReportStarter).to receive(:start_report) .with( 'self', 'proservices_provisioning_csv', { parameters: { include_deleted: true, 'users' => true, 'courses' => true, } }, ) CanvasSync::Jobs::SyncProvisioningReportJob.perform_now( { models: ['users', 'courses'] } ) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems