Sha256: 158033bf5fb7b747354684ad30439e38c1d4601a9d2f5467b4d4df60bcb807df

Contents?: true

Size: 1.45 KB

Versions: 14

Compression:

Stored size: 1.45 KB

Contents

require 'spec/support/provider_state_builder'

describe "Get diff between versions" do

  let(:path) { "/pacts/provider/Provider/consumer/Consumer/version/3/diff/previous-distinct" }

  let(:last_response_body) { JSON.parse(subject.body, symbolize_names: true) }

  subject { get path; last_response }

  let(:pact_content_version_1) do
    hash = load_json_fixture('consumer-provider.json')
    hash['interactions'].first['request']['method'] = 'post'
    hash.to_json
  end
  let(:pact_content_version_2) { load_fixture('consumer-provider.json') }
  let(:pact_content_version_3) { pact_content_version_2 }

  before do
    ProviderStateBuilder.new
      .create_consumer("Consumer")
      .create_provider("Provider")
      .create_consumer_version("1")
      .create_pact(pact_content_version_1)
      .create_consumer_version("2")
      .create_pact(pact_content_version_2)
      .create_consumer_version("3")
      .create_pact(pact_content_version_3)
  end

  context "when the versions exist" do

    it "returns a 200 HAL JSON response" do
      expect(subject).to be_a_hal_json_success_response
    end

    it "returns the JSON representation of the diff" do
      expect(last_response_body).to include({})
    end

  end

  context "when either version does not exist" do

    let(:path) { "/pacts/provider/Provider/consumer/Consumer/versions/1/diff/previous-distinct" }

    xit "returns a 404 response" do
      expect(subject).to be_a_404_response
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
pact_broker-1.11.1 spec/features/get_diff.rb
pact_broker-1.11.0 spec/features/get_diff.rb
pact_broker-1.10.0 spec/features/get_diff.rb
pact_broker-1.9.3 spec/features/get_diff.rb
pact_broker-1.9.2 spec/features/get_diff.rb
pact_broker-1.9.1 spec/features/get_diff.rb
pact_broker-1.9.0 spec/features/get_diff.rb
pact_broker-1.9.0.rc1 spec/features/get_diff.rb
pact_broker-1.8.1 spec/features/get_diff.rb
pact_broker-1.8.0 spec/features/get_diff.rb
pact_broker-1.7.0 spec/features/get_diff.rb
pact_broker-1.6.0 spec/features/get_diff.rb
pact_broker-1.5.0 spec/features/get_diff.rb
pact_broker-1.4.0 spec/features/get_diff.rb