Sha256: 95fb5680b8796de80a7525ac167fee5b947a5913fd662854393c7b73d65e19a1

Contents?: true

Size: 1.01 KB

Versions: 34

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe Maestrano::Connector::Rails::AllSynchronizationsJob do
  let(:organization_not_linked) { create(:organization, oauth_provider: 'salesforce', oauth_token: nil, sync_enabled: true) }
  let(:organization_not_active) { create(:organization, oauth_provider: 'salesforce', oauth_token: '123', sync_enabled: 0) }
  let(:organization_to_process) { create(:organization, oauth_provider: 'salesforce', oauth_token: '123', sync_enabled: true) }

  subject { Maestrano::Connector::Rails::AllSynchronizationsJob.perform_now() }

  describe 'perform' do
    it 'does not calls sync entity' do
      expect(Maestrano::Connector::Rails::SynchronizationJob).to_not receive(:perform_later).with(organization_not_linked, anything)
      expect(Maestrano::Connector::Rails::SynchronizationJob).to_not receive(:perform_later).with(organization_not_active, anything)
      expect(Maestrano::Connector::Rails::SynchronizationJob).to receive(:perform_later).with(organization_to_process, anything)

      subject
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
maestrano-connector-rails-0.4.4 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.4.3 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.4.2 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.4.1 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.4.0 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.13 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.12 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.11 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.10 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.9 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.8 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.7 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.6 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.5 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.4 spec/jobs/all_synchronizations_job_spec.rb
maestrano-connector-rails-0.3.3 spec/jobs/all_syncrhonizations_job_spec.rb
maestrano-connector-rails-0.3.2 spec/jobs/all_syncrhonizations_job_spec.rb
maestrano-connector-rails-0.3.1 spec/jobs/all_syncrhonizations_job_spec.rb
maestrano-connector-rails-0.3.0 spec/jobs/all_syncrhonizations_job_spec.rb
maestrano-connector-rails-0.2.20 spec/jobs/all_syncrhonizations_job_spec.rb