Sha256: 435f7e5d60f76d5b27301b4d23a6082b8f02de323cf971ce318912afbd3bbd49

Contents?: true

Size: 840 Bytes

Versions: 18

Compression:

Stored size: 840 Bytes

Contents

require 'test_helper'

describe Fanforce::PluginWorker::Errors do

  before do
    clean_dbs
  end

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

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

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

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

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fanforce-plugin-worker-2.0.0.rc15 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc14 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc13 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc12 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc11 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc10 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc9 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc8 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc7 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc6 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc5 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc4 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc3 test/controllers/error_test.rb
fanforce-plugin-worker-2.0.0.rc1 test/controllers/error_test.rb
fanforce-plugin-worker-1.6.0 test/controllers/error_test.rb
fanforce-plugin-worker-1.6.0.rc3 test/controllers/error_test.rb
fanforce-plugin-worker-1.6.0.rc2 test/controllers/error_test.rb
fanforce-plugin-worker-1.6.0.rc1 test/controllers/error_test.rb