Sha256: 76e22573f88b88e1ba6aa6dbcfd03e5aef6155b66852091bfd71570f24c8b1ac

Contents?: true

Size: 1.18 KB

Versions: 69

Compression:

Stored size: 1.18 KB

Contents

require "spec_helper"

RSpec.describe CanvasSync::Jobs::SyncContentMigrationsJob do
  describe "#perform" do
    context "no parameters is specified" do
      it "enqueues a ReportStarter for the proserv_content_migrations_csv" do
        expect_any_instance_of(Bearcat::Client).to receive(:start_report)
          .with("self", "proserv_content_migrations_csv", { parameters: { } })
          .and_return("id" => 1)

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

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

    context "updated_after parameters is specified" do
      it "enqueues a ReportStarter for the proserv_content_migrations_csv and get data from given date" do
        expect_any_instance_of(Bearcat::Client).to receive(:start_report)
          .with("self", "proserv_content_migrations_csv", { parameters: { updated_after: 6.hours.ago.to_s } })
          .and_return("id" => 1)

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

        set_batch_context(updated_after: 6.hours.ago.to_s)
        CanvasSync::Jobs::SyncContentMigrationsJob.perform_now({})
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

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