Sha256: f3f74323a0132e792444ba018ad09668049220eae27c56b6bc092651a1eb64c2

Contents?: true

Size: 687 Bytes

Versions: 3

Compression:

Stored size: 687 Bytes

Contents

require "spec_helper"

describe "Enqueueing jobs", type: :request do

  let(:job) { build_stubbed(:asyncapi_server_job, secret: "secret") }

  it "allows asynchronous handling of http requests and cleans up old jobs", cleaning_strategy: :truncation do
    post("/tests", job: {
      callback_url: "callback_url",
      params: {client: "params"}.to_json,
      secret: "secret",
    })

    expect(response).to be_successful
    parsed_response = indifferent_hash(response.body)[:job]
    expect(Asyncapi::Server::JobWorker).
      to have_enqueued_job(parsed_response[:id])
    expect(parsed_response[:url]).to be_present
    expect(parsed_response[:secret]).to eq "secret"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
asyncapi-server-1.1.3 spec/requests/enqueueing_jobs_spec.rb
asyncapi-server-1.1.2 spec/requests/enqueueing_jobs_spec.rb
asyncapi-server-1.1.1 spec/requests/enqueueing_jobs_spec.rb