Sha256: 0aa7dca90c0cc3e7c3aca15cceec977e1565601f1a878794ac1826dc85023025

Contents?: true

Size: 1.11 KB

Versions: 66

Compression:

Stored size: 1.11 KB

Contents

require 'support/test_data_builder'

describe "Updating a webhook" do
  let(:webhook) do
    TestDataBuilder.new
      .create_pact_with_hierarchy("Some Consumer", "1", "Some Provider")
      .create_global_webhook
      .and_return(:webhook)
  end

  let(:headers) { {'CONTENT_TYPE' => 'application/json'} }
  let(:response_body) { JSON.parse(last_response.body, symbolize_names: true)}
  let(:webhook_json) { webhook_hash.to_json }
  let(:webhook_hash) do
    {
      description: "trigger build",
      consumer: {
        name: "Some Consumer"
      },
      enabled: false,
      events: [{
        name: 'contract_published'
      }],
      request: {
        method: 'POST',
        url: 'https://example.org',
        headers: {
          :"Content-Type" => "application/json"
        },
        body: {
          a: 'body'
        }
      }
    }
  end

  subject { put(path, webhook_json, headers) }

  let(:path) { "/webhooks/#{webhook.uuid}" }

  context "with valid attributes" do
    it "returns the newly created webhook" do
      subject
      expect(response_body).to include description: "trigger build"
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
pact_broker-2.79.1 spec/features/update_webhook_spec.rb
pact_broker-2.79.0 spec/features/update_webhook_spec.rb
pact_broker-2.78.1 spec/features/update_webhook_spec.rb
pact_broker-2.78.0 spec/features/update_webhook_spec.rb
pact_broker-2.77.0 spec/features/update_webhook_spec.rb
pact_broker-2.76.2 spec/features/update_webhook_spec.rb
pact_broker-2.76.1 spec/features/update_webhook_spec.rb
pact_broker-2.76.0 spec/features/update_webhook_spec.rb
pact_broker-2.75.0 spec/features/update_webhook_spec.rb
pact_broker-2.74.1 spec/features/update_webhook_spec.rb
pact_broker-2.74.0 spec/features/update_webhook_spec.rb
pact_broker-2.73.0 spec/features/update_webhook_spec.rb
pact_broker-2.72.0 spec/features/update_webhook_spec.rb
pact_broker-2.71.0 spec/features/update_webhook_spec.rb
pact_broker-2.70.0 spec/features/update_webhook_spec.rb
pact_broker-2.69.0 spec/features/update_webhook_spec.rb
pact_broker-2.68.1 spec/features/update_webhook_spec.rb
pact_broker-2.68.0 spec/features/update_webhook_spec.rb
pact_broker-2.67.0 spec/features/update_webhook_spec.rb
pact_broker-2.66.0 spec/features/update_webhook_spec.rb