Sha256: d24d94e7c415e5e96d3d580b32c2c5666db8d43fae258f84849955d4240a0dab
Contents?: true
Size: 1.57 KB
Versions: 108
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) { FactoryGirl.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
108 entries across 108 versions & 1 rubygems