Sha256: a83c627dbdd3cf01005c1d6521b96c20dfb56016b0714be66febc09cbeb58c8c

Contents?: true

Size: 717 Bytes

Versions: 3

Compression:

Stored size: 717 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", params: {
      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.3.2 spec/requests/enqueueing_jobs_spec.rb
asyncapi-server-1.3.0 spec/requests/enqueueing_jobs_spec.rb
asyncapi-server-1.2.0 spec/requests/enqueueing_jobs_spec.rb