Sha256: a30469bcbbc9919767e9b67eff6a1c4d9602e3d74ec3ade29cad9bd2f4c2a2bf

Contents?: true

Size: 1.18 KB

Versions: 29

Compression:

Stored size: 1.18 KB

Contents

require "spec_helper"

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

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

        CanvasSync::Jobs::SyncContextModuleItemsJob.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_context_module_items_csv for all terms" do
        expect_any_instance_of(Bearcat::Client).to receive(:start_report)
          .with("self", "proserv_context_module_items_csv", {})
          .and_return("id" => 1)

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

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

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
canvas_sync-0.10.3 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.10.2 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.10.0 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.9.4 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.9.3 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.9.2 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.9.1 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.9.0 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.8.4 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.8.3 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.8.2 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.8.1 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.8.0 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.7.3 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.7.2 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.7.1 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.7.0 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.6.4 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.6.3 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb
canvas_sync-0.6.2 spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb