Sha256: c25276c6e2b6f373de9e898e593c99d386bf9a4b0f85370caae896aaace4160b

Contents?: true

Size: 1.17 KB

Versions: 15

Compression:

Stored size: 1.17 KB

Contents

require "spec_helper"

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

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

        CanvasSync::Jobs::SyncAssignmentsJob.perform_now({ jobs: [], global_options: { canvas_term_id: 1 } }, {})
      end
    end

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

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

        CanvasSync::Jobs::SyncAssignmentsJob.perform_now({ jobs: [], global_options: {} }, {})
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
canvas_sync-0.11.1 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.16.5 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.16.4 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.16.3 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.16.2 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.16.1 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.15.1 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.15.0 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.14.0 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.13.0 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.12.0 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.11.0 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.10.6 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.10.5 spec/canvas_sync/jobs/sync_assignments_job_spec.rb
canvas_sync-0.10.4 spec/canvas_sync/jobs/sync_assignments_job_spec.rb