Sha256: d7eb78fa5199d7634b212d5c0f46639a3b5f624d35539e0eb39fd1ad3c0a21ff

Contents?: true

Size: 579 Bytes

Versions: 12

Compression:

Stored size: 579 Bytes

Contents

require 'spec_helper'

RSpec.describe CanvasSync::Jobs::SyncRolesJob do
  describe '#perform' do
    let!(:account) { FactoryGirl.create(:account, canvas_id: 1) }
    let(:role_params) { open_canvas_fixture('roles') }
    let(:job_chain) { { jobs: [], global_options: {}} }

    it 'retrieves all roles from the Canvas API and then invokes the next job' do
      expect(CanvasSync).to receive(:invoke_next).with(job_chain)

      expect {
        CanvasSync::Jobs::SyncRolesJob.perform_now(job_chain, {})
      }.to change { Role.count }.by(role_params.length)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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