Sha256: e014c931072c737bd36a2240365d2db0eb1a24b68545e6494f0dbdd461e31d96

Contents?: true

Size: 753 Bytes

Versions: 1

Compression:

Stored size: 753 Bytes

Contents

require 'spec_helper'
require 'sidekiq/testing'

describe Maestrano::Connector::Rails::PushToConnecWorker do
  describe 'class method' do
    let(:organization) { create(:organization) }
    subject { Maestrano::Connector::Rails::PushToConnecWorker }

    Sidekiq::Testing.fake!
    it 'perform_async add a new job' do
      expect {
        subject.perform_async(1, 2, 3)
      }.to change(subject.jobs, :size).by(1)
    end

    describe 'unique_args' do
      it do
        entities_hash = {entity_2: [{'id': 'id2'}, {'id': 'id1'}], entity_1: [{'id': 'id4'}, {'id': nil}, {'id': 'id3'}, {'id': 'id3'}]}
        expect(subject.unique_args([organization, entities_hash])).to eq([organization.id, [:entity_1, :entity_2]])
      end
    end
  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
maestrano-connector-rails-1.2.1 spec/jobs/push_to_connec_worker_spec.rb