Sha256: 264b10c84eb0723bff20066e898a535a033ca22cbfcc392212694f17ea381654

Contents?: true

Size: 707 Bytes

Versions: 25

Compression:

Stored size: 707 Bytes

Contents

require 'spec_helper'

require 'rollbar/delayed_job'
require 'delayed/backend/test'

describe Rollbar::Delayed::JobData do
  describe '#to_hash' do
    let(:handler) { { 'foo' => 'bar' } }

    let(:attrs) do
      {
        'id' => 1,
        'priority' => 0,
        'attempts' => 1,
        'handler' => handler.to_yaml
      }
    end

    let(:job) do
      ::Delayed::Backend::Test::Job.new(attrs)
    end

    subject { described_class.new(job) }

    it 'returns the correct job data' do
      expected_result = attrs.dup
      expected_result.delete('id')
      expected_result['handler'] = handler

      result = subject.to_hash

      expect(result).to be_eql(expected_result)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
rollbar-2.12.0 spec/rollbar/plugins/delayed_job/job_data.rb
rollbar-2.11.5 spec/rollbar/plugins/delayed_job/job_data.rb
rollbar-2.11.4 spec/rollbar/plugins/delayed_job/job_data.rb
rollbar-2.11.3 spec/rollbar/plugins/delayed_job/job_data.rb
rollbar-2.11.2 spec/rollbar/plugins/delayed_job/job_data.rb
rollbar-2.11.1 spec/rollbar/plugins/delayed_job/job_data.rb
rollbar-2.11.0 spec/rollbar/plugins/delayed_job/job_data.rb
rollbar-2.10.0 spec/rollbar/delayed_job/job_data.rb
rollbar-2.9.1 spec/rollbar/delayed_job/job_data.rb
rollbar-2.9.0 spec/rollbar/delayed_job/job_data.rb
rollbar-2.8.3 spec/rollbar/delayed_job/job_data.rb
rollbar-2.8.2 spec/rollbar/delayed_job/job_data.rb
rollbar-2.8.1 spec/rollbar/delayed_job/job_data.rb
rollbar-2.8.0 spec/rollbar/delayed_job/job_data.rb
rollbar-2.7.1 spec/rollbar/delayed_job/job_data.rb
rollbar-2.7.0 spec/rollbar/delayed_job/job_data.rb
rollbar-2.6.3 spec/rollbar/delayed_job/job_data.rb
rollbar-2.6.2 spec/rollbar/delayed_job/job_data.rb
rollbar-2.6.1 spec/rollbar/delayed_job/job_data.rb
rollbar-2.6.0 spec/rollbar/delayed_job/job_data.rb