Sha256: 443f13ad240feaaeeea04dad1b4a686ff6f8334be4faee753e987c3da390c821

Contents?: true

Size: 613 Bytes

Versions: 12

Compression:

Stored size: 613 Bytes

Contents

require 'test_helper'

describe Fanforce::AppWorker do

  before do
    clean_dbs
  end

  it 'should enqueue a job' do
    Fanforce::AppWorker.enqueue('test', {name: 'caleb'})
    assert Fanforce::AppWorker.iron_mq.queue('test').size == 1
  end

  it 'should run an enqueued job' do
    Fanforce::AppWorker.enqueue('test', {name: 'caleb'})
    processed_job = false

    Fanforce::AppWorker.run({'queue_id' => 'test'}) do |params|
      processed_job = true
      assert params[:name] == 'caleb'
    end

    assert processed_job == true
    assert Fanforce::AppWorker.iron_mq.queue('test').size == 0
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fanforce-app-worker-1.1.0.rc8 test/controllers/enqueue_test.rb
fanforce-app-worker-1.1.0.rc7 test/controllers/enqueue_test.rb
fanforce-app-worker-1.1.0.rc6 test/controllers/enqueue_test.rb
fanforce-app-worker-1.1.0.rc5 test/controllers/enqueue_test.rb
fanforce-app-worker-1.1.0.rc4 test/controllers/enqueue_test.rb
fanforce-app-worker-1.1.0.rc3 test/controllers/enqueue_test.rb
fanforce-app-worker-1.1.0.rc2 test/controllers/enqueue_test.rb
fanforce-app-worker-1.1.0.rc1 test/controllers/enqueue_test.rb
fanforce-app-worker-1.0.3 test/controllers/enqueue_test.rb
fanforce-app-worker-1.0.2 test/controllers/enqueue_test.rb
fanforce-app-worker-1.0.1 test/controllers/enqueue_test.rb
fanforce-app-worker-1.0.0 test/controllers/enqueue_test.rb