Sha256: 153d8de1e4604af70db22279827e1fc349c028f4f7b0a25a1f9969e673eca171

Contents?: true

Size: 819 Bytes

Versions: 18

Compression:

Stored size: 819 Bytes

Contents

require 'test_helper'
require 'fanforce/worker/errors'

describe Fanforce::Worker::Errors do

  before do
    clean_dbs
  end

  it 'should save error to redis' do
    Fanforce::Worker.enqueue('test', {name: 'caleb'})
    ran_job = false

    Fanforce::Worker.run({'queue_id' => 'test'}) do |params|
      ran_job = true
      raise 'test'
    end
    assert ran_job == true
    assert Fanforce::Worker::Errors.list_summaries('test').size == 1
    assert Fanforce::Worker.iron_mq.queue('test').size == 0
  end

  it 'should correctly retry error' do
    Fanforce::Worker.enqueue('test', {name: 'caleb'})

    Fanforce::Worker.run({'queue_id' => 'test'}) do |params|
      raise 'test'
    end
    assert Fanforce::Worker::Errors.list('test').retry
    assert Fanforce::Worker.iron_mq.queue('test').size == 1
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fanforce-worker-0.36.0 test/controllers/error_test.rb
fanforce-worker-0.35.0 test/controllers/error_test.rb
fanforce-worker-0.32.0 test/controllers/error_test.rb
fanforce-worker-0.31.0 test/controllers/error_test.rb
fanforce-worker-0.30.0 test/controllers/error_test.rb
fanforce-worker-0.21.1 test/controllers/error_test.rb
fanforce-worker-0.21.0 test/controllers/error_test.rb
fanforce-worker-0.20.1 test/controllers/error_test.rb
fanforce-worker-0.20.0 test/controllers/error_test.rb
fanforce-worker-0.19.3 test/controllers/error_test.rb
fanforce-worker-0.19.2 test/controllers/error_test.rb
fanforce-worker-0.19.1 test/controllers/error_test.rb
fanforce-worker-0.19.0 test/controllers/error_test.rb
fanforce-worker-0.18.1 test/controllers/error_test.rb
fanforce-worker-0.18.0 test/controllers/error_test.rb
fanforce-worker-0.17.2 test/controllers/error_test.rb
fanforce-worker-0.17.1 test/controllers/error_test.rb
fanforce-worker-0.17.0 test/controllers/error_test.rb