Sha256: cd39d8ed1df7a486eedfd4a03c206efa1dee52ff2e57a23def231cc54f2e11a8

Contents?: true

Size: 1.13 KB

Versions: 126

Compression:

Stored size: 1.13 KB

Contents

require "spec_helper"

RSpec.describe CanvasSync::Jobs::SyncContextModulesJob do
  describe "#perform" do
    context "a term id is in the global_options" do
      it "enqueues a ReportStarter for the proserv_context_modules_csv for the given term" do
        expect_any_instance_of(Bearcat::Client).to receive(:start_report)
          .with("self", "proserv_context_modules_csv", { parameters: { enrollment_term_id: 1 } })
          .and_return("id" => 1)

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

        set_batch_context(canvas_term_id: 1)
        CanvasSync::Jobs::SyncContextModulesJob.perform_now({})
      end
    end

    context "no term id is specified" do
      it "enqueues a ReportStarter for the proserv_context_modules_csv for all terms" do
        expect_any_instance_of(Bearcat::Client).to receive(:start_report)
          .with("self", "proserv_context_modules_csv", { parameters: { } })
          .and_return("id" => 1)

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

        CanvasSync::Jobs::SyncContextModulesJob.perform_now({})
      end
    end
  end
end

Version data entries

126 entries across 126 versions & 1 rubygems

Version Path
canvas_sync-0.22.9 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.8 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.6 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.5 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.4 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.3 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.2 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.1 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0.beta8 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0.beta7 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0.beta6 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0.beta5 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0.beta4 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0.beta3 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0.beta2 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.22.0.beta1 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.21.1 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.21.1.beta1 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb
canvas_sync-0.21.0 spec/canvas_sync/jobs/sync_context_modules_job_spec.rb