Sha256: 12927bd937f6da1fcddea5c17d71d1a2fd19e385470d46a5805b4e9134748225

Contents?: true

Size: 595 Bytes

Versions: 18

Compression:

Stored size: 595 Bytes

Contents

require 'test_helper'

describe Fanforce::Worker do

  before do
    clean_dbs
  end

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

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

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

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

end

Version data entries

18 entries across 18 versions & 1 rubygems

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