Sha256: 4264c6cc80759f97a095641ee748305f54bf503df2d392c3a3588c686e2917d6
Contents?: true
Size: 1.36 KB
Versions: 81
Compression:
Stored size: 1.36 KB
Contents
require 'pact_broker/client/pacts/list_latest_versions' module PactBroker::Client describe Pacts::ListLatestVersions, :pact => true do let(:pact_broker_client) { PactBrokerClient.new(base_url: 'http://localhost:1234') } describe "listing pacts" do context "when pacts exist" do let(:response_body) { JSON.parse(File.read("./spec/support/pacts_latest_list.json"))} let(:expected_pacts) do [{ :consumer => { :name => 'Condor', :version => { :number => '1.3.0' } }, :provider => { :name => 'Pricing Service' } } ] end before do pact_broker. given("a pact between Condor and the Pricing Service exists"). upon_receiving("a request to list the latest pacts"). with( method: :get, path: '/pacts/latest', headers: {} ). will_respond_with( headers: {'Content-Type' => Pact.term(generate: 'application/hal+json', matcher: %r{application/hal\+json})}, status: 200, body: response_body ) end it "returns the response body" do expect(pact_broker_client.pacts.list_latest).to eq(expected_pacts) end end end end end
Version data entries
81 entries across 81 versions & 1 rubygems