Sha256: d05224e3a4cc3384e663c3e7acb54864b56f8c131f73e712a1643e54ebcd8860

Contents?: true

Size: 1.57 KB

Versions: 7

Compression:

Stored size: 1.57 KB

Contents

require 'spec_helper'

RSpec.describe CanvasSync::Jobs::SyncSimpleTableJob do
  describe '#perform' do
    context 'Simple report' do
      let!(:term) { FactoryBot.create(:term) }

      it 'enqueues a ReportStarter for a provisioning report for the specified model for a term' do
        expect(CanvasSync::Jobs::ReportStarter).to receive(:perform_later)
          .with(
            'proservices_provisioning_csv',
            {
              "parameters[include_deleted]" => true,
              "parameters[courses]" => true,
              "parameters[enrollment_term_id]" => term.canvas_id
            },
            CanvasSync::Processors::NormalProcessor.to_s,
            {
              report_name: 'proservices_provisioning_csv',
              model: 'courses',
              mapping: 'courses',
              klass: 'Course',
              term_scope: 'active',
              params: {
                "parameters[include_deleted]" => true,
                "parameters[courses]" => true,
                "parameters[enrollment_term_id]" => term.canvas_id
              }
            }
          )

        set_batch_context(canvas_term_id: term.canvas_id)

        CanvasSync::Jobs::SyncSimpleTableJob.perform_now(
          {
            report_name: 'proservices_provisioning_csv',
            model: 'courses',
            mapping: 'courses',
            klass: 'Course',
            term_scope: 'active',
            params: {
              "parameters[include_deleted]" => true,
              "parameters[courses]" => true
            }
          }
        )

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
canvas_sync-0.22.9 spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
canvas_sync-0.22.8 spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
canvas_sync-0.22.6 spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
canvas_sync-0.22.5 spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
canvas_sync-0.22.4 spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
canvas_sync-0.22.3 spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
canvas_sync-0.22.2 spec/canvas_sync/jobs/sync_simple_table_job_spec.rb