Sha256: a332453426b5fc9854b58a4105093b3558a31aa581205d0661465422c257ca1e

Contents?: true

Size: 927 Bytes

Versions: 7

Compression:

Stored size: 927 Bytes

Contents

require "rails_helper"
require "serverengine"
require "sneakers"
require "sneakers/runner"
require "external_sneaker"

describe TestWorker, :skip do
  include FileHelper
  let(:message) do
    {
      title: "Cool",
      body: "Hot",
    }
  end

  before do
    @sneakers_worker = ExternalSneaker.new("rake sneakers:run", described_class)
    @sneakers_worker.start
    Sneakers.publish(
      message.to_json,
      to_queue: described_class::QUEUE_NAME,
      routing_key: described_class::ROUTING_KEY,
    )
  end

  after do
    delete_file("config/sapience.yml")
    delete_file(described_class::VERIFICATION_FILE)
  end

  # TODO: Possible make this less flaky or run it with retry (rspec-retry)
  it "runs properly" do
    count = 0
    until File.exist?(described_class::VERIFICATION_FILE)
      sleep 0.1
      count += 1
      expect(true).to be(false) if count > 240
    end
    expect(true).to be(true)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sapience-1.0.11 test_apps/rails/spec/workers/test_worker_spec.rb
sapience-1.0.10 test_apps/rails/spec/workers/test_worker_spec.rb
sapience-1.0.9 test_apps/rails/spec/workers/test_worker_spec.rb
sapience-1.0.8 test_apps/rails/spec/workers/test_worker_spec.rb
sapience-1.0.7 test_apps/rails/spec/workers/test_worker_spec.rb
sapience-1.0.6 test_apps/rails/spec/workers/test_worker_spec.rb
sapience-1.0.5 test_apps/rails/spec/workers/test_worker_spec.rb