Sha256: 597f169474370b3152807eed43b894af348ca821b4413773c4d44ed971120ac5

Contents?: true

Size: 661 Bytes

Versions: 13

Compression:

Stored size: 661 Bytes

Contents

require 'spec_helper'

describe Services::Asyncable do
  describe '#perform' do
    it 'calls `call` with the correct args' do
      expect { AsyncService.new.perform 'test', pelle: 'fant' }.to raise_error(%w(test baz fant).to_json)

      # If the `call` method arguments contains kwargs and the last argument to `perform` is a Hash,
      # it's keys should be symbolized. The reason is that the arguments to `perform` are serialized to
      # the database before Sidekiq picks them up, i.e. symbol keys are converted to strings.
      expect { AsyncService.new.perform 'test', 'pelle' => 'fant' }.to raise_error(%w(test baz fant).to_json)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
services-9.0.0 spec/services/asyncable_spec.rb
services-8.0.1 spec/services/asyncable_spec.rb
services-8.0.0 spec/services/asyncable_spec.rb
services-7.3.3 spec/services/asyncable_spec.rb
services-7.3.1 spec/services/asyncable_spec.rb
services-7.3.0 spec/services/asyncable_spec.rb
services-7.2.1 spec/services/asyncable_spec.rb
services-7.2.0 spec/services/asyncable_spec.rb
services-7.1.2 spec/services/asyncable_spec.rb
services-7.1.1 spec/services/asyncable_spec.rb
services-7.1.0 spec/services/asyncable_spec.rb
services-7.0.3 spec/services/asyncable_spec.rb
services-7.0.2 spec/services/asyncable_spec.rb