Sha256: ac352c3af254770ddb5b6687ac13d8335178d2ba41e27f3fb7f922782867bea5

Contents?: true

Size: 891 Bytes

Versions: 107

Compression:

Stored size: 891 Bytes

Contents

require 'support/test_data_builder'

describe "Creating a pacticipant" do
  let(:path) { "/pacticipants" }
  let(:headers) { {'CONTENT_TYPE' => 'application/json'} }
  let(:response_body) { JSON.parse(last_response.body, symbolize_names: true)}
  let(:pacticipant_hash) { { name: 'Foo Thing' } }

  subject { post path, pacticipant_hash.to_json, headers; last_response }

  it "returns a 201 response" do
    subject
    expect(last_response.status).to be 201
  end

  it "returns the Location header" do
    subject
    expect(last_response.headers['Location']).to eq 'http://example.org/pacticpants/Foo%20Thing'
  end

  it "returns a JSON Content Type" do
    subject
    expect(last_response.headers['Content-Type']).to eq 'application/hal+json;charset=utf-8'
  end

  it "returns the newly created webhook" do
    subject
    expect(response_body).to include pacticipant_hash
  end
end

Version data entries

107 entries across 107 versions & 1 rubygems

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