Sha256: 520c841a4400bf4d9a42ebacc796d48586495c1ee575af8d82c811eb1d87b3bd

Contents?: true

Size: 436 Bytes

Versions: 5

Compression:

Stored size: 436 Bytes

Contents

require 'test_helper'

class Workhorse::WorkerTest < WorkhorseTest
  # This test makes sure that concurrent jobs always work in different database
  # connections.
  def test_db_connections
    2.times do
      Workhorse.enqueue DbConnectionTestJob.new
    end

    work 0.2, polling_interval: 0.2

    assert_equal 2, DbConnectionTestJob.db_connections.count
    assert_equal 2, DbConnectionTestJob.db_connections.uniq.count
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
workhorse-0.3.4 test/workhorse/performer_test.rb
workhorse-0.3.3 test/workhorse/performer_test.rb
workhorse-0.3.2 test/workhorse/performer_test.rb
workhorse-0.3.1 test/workhorse/performer_test.rb
workhorse-0.3.0 test/workhorse/performer_test.rb