|
1 | 1 | require_relative 'helper'
|
2 |
| -require 'pact/pact_broker/fetch_wip_pacts' |
| 2 | +require 'pact/pact_broker/fetch_pending_pacts' |
3 | 3 |
|
4 |
| -describe Pact::PactBroker::FetchWipPacts, pact: true do |
| 4 | +describe Pact::PactBroker::FetchPendingPacts, pact: true do |
5 | 5 | before do
|
6 | 6 | allow($stdout).to receive(:puts)
|
7 | 7 | end
|
|
15 | 15 |
|
16 | 16 | before do
|
17 | 17 | pact_broker
|
18 |
| - .given('the relation for retrieving WIP pacts exists in the index resource') |
| 18 | + .given('the relation for retrieving pending pacts exists in the index resource') |
19 | 19 | .upon_receiving('a request for the index resource')
|
20 | 20 | .with(
|
21 | 21 | method: :get,
|
|
26 | 26 | status: 200,
|
27 | 27 | body: {
|
28 | 28 | _links: {
|
29 |
| - 'beta:wip-provider-pacts' => { |
| 29 | + 'beta:pending-provider-pacts' => { |
30 | 30 | href: Pact.term(
|
31 |
| - generate: broker_base_url + 'pacts/provider/{provider}/wip', |
32 |
| - matcher: %r{/pacts/provider/{provider}/wip$} |
| 31 | + generate: broker_base_url + 'pacts/provider/{provider}/pending', |
| 32 | + matcher: %r{/pacts/provider/{provider}/pending$} |
33 | 33 | )
|
34 | 34 | }
|
35 | 35 | }
|
36 | 36 | }
|
37 | 37 | )
|
38 | 38 | end
|
39 | 39 |
|
40 |
| - context 'retrieving WIP pacts by provider' do |
| 40 | + context 'retrieving pending pacts by provider' do |
41 | 41 | before do
|
42 | 42 | pact_broker
|
43 |
| - .given('consumer-1 has a WIP pact with provider provider-1') |
44 |
| - .upon_receiving('a request to retrieve the WIP pacts for provider') |
| 43 | + .given('consumer-1 has a pending pact with provider provider-1') |
| 44 | + .upon_receiving('a request to retrieve the pending pacts for provider') |
45 | 45 | .with(
|
46 | 46 | method: :get,
|
47 |
| - path: '/pacts/provider/provider-1/wip', |
| 47 | + path: '/pacts/provider/provider-1/pending', |
48 | 48 | headers: get_headers
|
49 | 49 | )
|
50 | 50 | .will_respond_with(
|
|
62 | 62 | end
|
63 | 63 |
|
64 | 64 | it 'returns the array of pact urls' do
|
65 |
| - pacts = Pact::PactBroker::FetchWipPacts.call(provider, broker_base_url, basic_auth_options) |
| 65 | + pacts = Pact::PactBroker::FetchPendingPacts.call(provider, broker_base_url, basic_auth_options) |
66 | 66 | expect(pacts).to eq(
|
67 | 67 | [
|
68 | 68 | Pact::Provider::PactURI.new('http://pact-broker-url-for-consumer-1', basic_auth_options)
|
|
0 commit comments