pact_broker 2.66.0 → 2.67.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/Gemfile +1 -0
- data/db/migrations/20201006_add_wip_to_verification.rb +5 -0
- data/lib/db.rb +3 -1
- data/lib/pact_broker/api/decorators/verifiable_pact_decorator.rb +4 -2
- data/lib/pact_broker/api/pact_broker_urls.rb +10 -6
- data/lib/pact_broker/api/paths.rb +4 -3
- data/lib/pact_broker/api/resources/can_i_deploy.rb +14 -0
- data/lib/pact_broker/api/resources/group.rb +0 -1
- data/lib/pact_broker/api/resources/latest_pact.rb +1 -1
- data/lib/pact_broker/api/resources/pact.rb +8 -0
- data/lib/pact_broker/api/resources/pact_versions.rb +4 -0
- data/lib/pact_broker/api/resources/pact_webhooks.rb +1 -1
- data/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +1 -2
- data/lib/pact_broker/api/resources/tag.rb +0 -1
- data/lib/pact_broker/api/resources/tagged_pact_versions.rb +4 -0
- data/lib/pact_broker/api/resources/verification.rb +4 -0
- data/lib/pact_broker/api/resources/verifications.rb +14 -2
- data/lib/pact_broker/groups/service.rb +0 -3
- data/lib/pact_broker/locale/en.yml +1 -0
- data/lib/pact_broker/matrix/aggregated_row.rb +1 -0
- data/lib/pact_broker/matrix/query_results_with_deployment_status_summary.rb +1 -0
- data/lib/pact_broker/pacts/all_pact_publications.rb +1 -0
- data/lib/pact_broker/pacts/pact_publication.rb +1 -0
- data/lib/pact_broker/pacts/repository.rb +1 -0
- data/lib/pact_broker/pacts/verifiable_pact_messages.rb +2 -0
- data/lib/pact_broker/test/test_data_builder.rb +1 -1
- data/lib/pact_broker/verifications/service.rb +2 -1
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +1 -1
- data/spec/features/create_webhook_spec.rb +18 -0
- data/spec/features/wip_pacts_spec.rb +258 -33
- data/spec/fixtures/approvals/modifiable_resources.approved.json +74 -0
- data/spec/lib/pact_broker/api/decorators/relationships_csv_decorator_spec.rb +0 -3
- data/spec/lib/pact_broker/api/decorators/verifiable_pact_decorator_spec.rb +7 -2
- data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +6 -5
- data/spec/lib/pact_broker/api/resources/can_i_deploy_spec.rb +51 -0
- data/spec/lib/pact_broker/api/resources/default_base_resource_approval_spec.rb +59 -0
- data/spec/lib/pact_broker/api/resources/latest_pact_spec.rb +2 -2
- data/spec/lib/pact_broker/api/resources/verifications_spec.rb +17 -3
- data/spec/lib/pact_broker/pacts/latest_tagged_pact_publications_spec.rb +1 -1
- data/spec/lib/pact_broker/pacts/repository_find_wip_pact_versions_for_provider_spec.rb +24 -2
- data/spec/lib/pact_broker/verifications/service_spec.rb +4 -2
- data/spec/lib/pact_broker/webhooks/render_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -0
- metadata +9 -2
@@ -0,0 +1,74 @@
|
|
1
|
+
{
|
2
|
+
"resource_classes": [
|
3
|
+
{
|
4
|
+
"resource_class_name": "PactBroker::Api::Resources::AllWebhooks"
|
5
|
+
},
|
6
|
+
{
|
7
|
+
"resource_class_name": "PactBroker::Api::Resources::ErrorTest"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"resource_class_name": "PactBroker::Api::Resources::Integration"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"resource_class_name": "PactBroker::Api::Resources::Integrations"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"resource_class_name": "PactBroker::Api::Resources::Label"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"resource_class_name": "PactBroker::Api::Resources::LatestVerificationForLatestPact",
|
20
|
+
"resource_class_data": "provider"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"resource_class_name": "PactBroker::Api::Resources::LatestVerificationForPact",
|
24
|
+
"resource_class_data": "provider"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"resource_class_name": "PactBroker::Api::Resources::Pact",
|
28
|
+
"resource_class_data": "consumer"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"resource_class_name": "PactBroker::Api::Resources::PactVersions",
|
32
|
+
"resource_class_data": "consumer"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"resource_class_name": "PactBroker::Api::Resources::PactWebhooks"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"resource_class_name": "PactBroker::Api::Resources::Pacticipant"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"resource_class_name": "PactBroker::Api::Resources::Pacticipants"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"resource_class_name": "PactBroker::Api::Resources::ProviderPactsForVerification"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"resource_class_name": "PactBroker::Api::Resources::Tag"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"resource_class_name": "PactBroker::Api::Resources::TaggedPactVersions",
|
51
|
+
"resource_class_data": "consumer"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"resource_class_name": "PactBroker::Api::Resources::Verification",
|
55
|
+
"resource_class_data": "provider"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"resource_class_name": "PactBroker::Api::Resources::Verifications",
|
59
|
+
"resource_class_data": "provider"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"resource_class_name": "PactBroker::Api::Resources::Version"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"resource_class_name": "PactBroker::Api::Resources::Webhook"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"resource_class_name": "PactBroker::Api::Resources::WebhookExecution"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"resource_class_name": "PactBroker::Api::Resources::Webhooks"
|
72
|
+
}
|
73
|
+
]
|
74
|
+
}
|
@@ -2,11 +2,8 @@ require 'spec_helper'
|
|
2
2
|
require 'pact_broker/api/decorators/relationships_csv_decorator'
|
3
3
|
|
4
4
|
module PactBroker
|
5
|
-
|
6
5
|
module Api
|
7
|
-
|
8
6
|
module Decorators
|
9
|
-
|
10
7
|
describe RelationshipsCsvDecorator do
|
11
8
|
|
12
9
|
let(:pact) { TestDataBuilder.new.create_pact_with_hierarchy("My Consumer", "1.0", "My Provider").and_return(:pact) }
|
@@ -5,7 +5,7 @@ module PactBroker
|
|
5
5
|
module Decorators
|
6
6
|
describe VerifiablePactDecorator do
|
7
7
|
before do
|
8
|
-
allow_any_instance_of(PactBroker::Api::PactBrokerUrls).to receive(:
|
8
|
+
allow_any_instance_of(PactBroker::Api::PactBrokerUrls).to receive(:pact_version_url_with_metadata).and_return('http://pact')
|
9
9
|
allow(PactBroker::Pacts::BuildVerifiablePactNotices).to receive(:call).and_return(notices)
|
10
10
|
allow_any_instance_of(PactBroker::Pacts::VerifiablePactMessages).to receive(:pact_version_short_description).and_return('short desc')
|
11
11
|
end
|
@@ -61,7 +61,7 @@ module PactBroker
|
|
61
61
|
end
|
62
62
|
|
63
63
|
it "creates the pact version url" do
|
64
|
-
expect(decorator).to receive(:
|
64
|
+
expect(decorator).to receive(:pact_version_url_with_metadata).with(pact, nil, 'http://example.org')
|
65
65
|
subject
|
66
66
|
end
|
67
67
|
|
@@ -84,6 +84,11 @@ module PactBroker
|
|
84
84
|
it "includes the wip flag" do
|
85
85
|
expect(subject['verificationProperties']['wip']).to be true
|
86
86
|
end
|
87
|
+
|
88
|
+
it "includes it in the metadata" do
|
89
|
+
expect(decorator).to receive(:pact_version_url_with_metadata).with(pact, { wip: true }, 'http://example.org')
|
90
|
+
subject
|
91
|
+
end
|
87
92
|
end
|
88
93
|
end
|
89
94
|
end
|
@@ -111,25 +111,26 @@ module PactBroker
|
|
111
111
|
end
|
112
112
|
|
113
113
|
it "builds the webhook metadata" do
|
114
|
-
|
114
|
+
encoded_metadata = PactBrokerUrls.encode_metadata(PactBrokerUrls.build_metadata_for_webhook_triggered_by_pact_publication(pact))
|
115
|
+
expect(PactBrokerUrls.decode_pact_metadata(encoded_metadata)).to eq (expected_metadata)
|
115
116
|
end
|
116
117
|
end
|
117
118
|
|
118
|
-
describe "
|
119
|
+
describe "decode_pact_metadata" do
|
119
120
|
context "when the metadata is nil" do
|
120
121
|
it "returns an empty hash" do
|
121
|
-
expect(PactBrokerUrls.
|
122
|
+
expect(PactBrokerUrls.decode_pact_metadata(nil)).to eq({})
|
122
123
|
end
|
123
124
|
end
|
124
125
|
|
125
126
|
context "when the metadata is not valid base64" do
|
126
127
|
it "returns an empty hash" do
|
127
|
-
expect(PactBrokerUrls.
|
128
|
+
expect(PactBrokerUrls.decode_pact_metadata("foo==,")).to eq({})
|
128
129
|
end
|
129
130
|
|
130
131
|
it "logs a warning" do
|
131
132
|
expect(logger).to receive(:warn).with("Exception parsing webhook metadata: foo==,", ArgumentError)
|
132
|
-
PactBrokerUrls.
|
133
|
+
PactBrokerUrls.decode_pact_metadata("foo==,")
|
133
134
|
end
|
134
135
|
end
|
135
136
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'pact_broker/api/resources/can_i_deploy'
|
2
|
+
|
3
|
+
module PactBroker
|
4
|
+
module Api
|
5
|
+
module Resources
|
6
|
+
describe CanIDeploy do
|
7
|
+
include_context "stubbed services"
|
8
|
+
|
9
|
+
before do
|
10
|
+
allow(pacticipant_service).to receive(:find_pacticipant_by_name).and_return(pacticipant)
|
11
|
+
allow(matrix_service).to receive(:find).and_return(results)
|
12
|
+
allow_any_instance_of(described_class).to receive(:matrix_service).and_return(matrix_service)
|
13
|
+
allow(PactBroker::Api::Decorators::MatrixDecorator).to receive(:new).and_return(decorator)
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:results) { double('results') }
|
17
|
+
let(:pacticipant) { double('pacticipant') }
|
18
|
+
let(:decorator) { instance_double('PactBroker::Api::Decorators::MatrixDecorator', to_json: 'response_body') }
|
19
|
+
let(:matrix_service) { class_double("PactBroker::Matrix::Service").as_stubbed_const }
|
20
|
+
|
21
|
+
let(:query) do
|
22
|
+
{
|
23
|
+
pacticipant: "Foo",
|
24
|
+
version: "1.2.3",
|
25
|
+
to: "prod"
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
subject { get("/can-i-deploy", query, { 'HTTP_ACCEPT' => 'application/hal+json'}) }
|
30
|
+
|
31
|
+
context "with the wrong query" do
|
32
|
+
let(:query) { {} }
|
33
|
+
|
34
|
+
it "returns a 400" do
|
35
|
+
expect(subject.status).to eq 400
|
36
|
+
expect(JSON.parse(subject.body)["errors"]["pacticipant"].first).to_not be_empty
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "when the pacticipant does not exist" do
|
41
|
+
let(:pacticipant) { nil }
|
42
|
+
|
43
|
+
it "returns a 400" do
|
44
|
+
expect(subject.status).to eq 400
|
45
|
+
expect(JSON.parse(subject.body)["errors"]["pacticipant"].first).to match /Foo.*found/
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'pact_broker/api/resources'
|
2
|
+
|
3
|
+
module PactBroker
|
4
|
+
module Api
|
5
|
+
module Resources
|
6
|
+
RSpec.describe "modifiable resources (ones that require write access)" do
|
7
|
+
let(:pact_broker_resource_classes) do
|
8
|
+
all_resources = ObjectSpace.each_object(::Class)
|
9
|
+
.select { |klass| klass < DefaultBaseResource }
|
10
|
+
.select(&:name)
|
11
|
+
.reject { |klass| klass.name.end_with?("BaseResource") }
|
12
|
+
.sort_by(&:name)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "specifies which pacticipant is the one relevant to the policy" do
|
16
|
+
data = pact_broker_resource_classes.collect do | resource_class |
|
17
|
+
request = double('request', uri: URI("http://example.org")).as_null_object
|
18
|
+
response = double('response')
|
19
|
+
resource = resource_class.new(request, response)
|
20
|
+
modifiable = resource.allowed_methods.any?{ | method | %w{PATCH POST PUT DELETE}.include?(method) }
|
21
|
+
# We only care about getting the right pacticipant for the policy if the
|
22
|
+
# resource itself can be modified.
|
23
|
+
# Read only resources can be read by anybody - no point wasting time getting the right pacticipant
|
24
|
+
if modifiable
|
25
|
+
def resource.consumer
|
26
|
+
'consumer'
|
27
|
+
end
|
28
|
+
|
29
|
+
def resource.provider
|
30
|
+
'provider'
|
31
|
+
end
|
32
|
+
|
33
|
+
def resource.pacticipant
|
34
|
+
'pacticipant'
|
35
|
+
end
|
36
|
+
|
37
|
+
def resource.resource_exists?
|
38
|
+
true
|
39
|
+
end
|
40
|
+
|
41
|
+
resource_class_data = {
|
42
|
+
resource_class_name: resource.class.name,
|
43
|
+
}
|
44
|
+
|
45
|
+
if resource.respond_to?(:policy_pacticipant)
|
46
|
+
resource_class_data[:resource_class_data] = resource.policy_pacticipant
|
47
|
+
end
|
48
|
+
resource_class_data
|
49
|
+
else
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
end.compact
|
53
|
+
|
54
|
+
Approvals.verify({ resource_classes: data }, :name => 'modifiable_resources', format: :json)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -55,7 +55,7 @@ module PactBroker::Api
|
|
55
55
|
before do
|
56
56
|
allow(PactBroker::Api::Decorators::PactDecorator).to receive(:new).and_return(decorator)
|
57
57
|
allow(PactBroker::Pacts::Metadata).to receive(:build_metadata_for_latest_pact).and_return(metadata)
|
58
|
-
allow_any_instance_of(LatestPact).to receive(:
|
58
|
+
allow_any_instance_of(LatestPact).to receive(:encode_metadata).and_return('encoded metadata')
|
59
59
|
end
|
60
60
|
|
61
61
|
it "builds the metadata" do
|
@@ -64,7 +64,7 @@ module PactBroker::Api
|
|
64
64
|
end
|
65
65
|
|
66
66
|
it "encodes the metadata" do
|
67
|
-
expect_any_instance_of(LatestPact).to receive(:
|
67
|
+
expect_any_instance_of(LatestPact).to receive(:encode_metadata).with(metadata)
|
68
68
|
subject
|
69
69
|
end
|
70
70
|
|
@@ -24,7 +24,7 @@ module PactBroker
|
|
24
24
|
before do
|
25
25
|
allow(PactBroker::Verifications::Service).to receive(:create).and_return(verification)
|
26
26
|
allow(PactBroker::Verifications::Service).to receive(:errors).and_return(double(:errors, messages: ['errors'], empty?: errors_empty))
|
27
|
-
allow(PactBrokerUrls).to receive(:
|
27
|
+
allow(PactBrokerUrls).to receive(:decode_pact_metadata).and_return(parsed_metadata)
|
28
28
|
allow_any_instance_of(Verifications).to receive(:webhook_execution_configuration).and_return(webhook_execution_configuration)
|
29
29
|
allow(webhook_execution_configuration).to receive(:with_webhook_context).and_return(webhook_execution_configuration)
|
30
30
|
end
|
@@ -65,7 +65,7 @@ module PactBroker
|
|
65
65
|
end
|
66
66
|
|
67
67
|
it "parses the webhook metadata" do
|
68
|
-
expect(PactBrokerUrls).to receive(:
|
68
|
+
expect(PactBrokerUrls).to receive(:decode_pact_metadata).with("abcd")
|
69
69
|
subject
|
70
70
|
end
|
71
71
|
|
@@ -85,7 +85,7 @@ module PactBroker
|
|
85
85
|
it "stores the verification in the database" do
|
86
86
|
expect(PactBroker::Verifications::Service).to receive(:create).with(
|
87
87
|
next_verification_number,
|
88
|
-
hash_including('some' => 'params'),
|
88
|
+
hash_including('some' => 'params', 'wip' => false),
|
89
89
|
pact,
|
90
90
|
{
|
91
91
|
webhook_execution_configuration: webhook_execution_configuration,
|
@@ -104,6 +104,20 @@ module PactBroker
|
|
104
104
|
it "returns the serialised verification in the response body" do
|
105
105
|
expect(subject.body).to eq serialised_verification
|
106
106
|
end
|
107
|
+
|
108
|
+
context "when the verification is for a wip pact" do
|
109
|
+
let(:parsed_metadata) { { wip: 'true' } }
|
110
|
+
|
111
|
+
it "merges that into the verification params" do
|
112
|
+
expect(PactBroker::Verifications::Service).to receive(:create).with(
|
113
|
+
anything,
|
114
|
+
hash_including('wip' => true),
|
115
|
+
anything,
|
116
|
+
anything
|
117
|
+
)
|
118
|
+
subject
|
119
|
+
end
|
120
|
+
end
|
107
121
|
end
|
108
122
|
|
109
123
|
context "when invalid parameters are used" do
|
@@ -87,7 +87,7 @@ module PactBroker
|
|
87
87
|
.create_consumer_version_tag("dev")
|
88
88
|
end
|
89
89
|
|
90
|
-
let(:selector) { PactBroker::Matrix::UnresolvedSelector.new(tag: true, latest: true, max_age:
|
90
|
+
let(:selector) { PactBroker::Matrix::UnresolvedSelector.new(tag: true, latest: true, max_age: 5) }
|
91
91
|
|
92
92
|
it "returns matching rows" do
|
93
93
|
expect(subject.count).to eq 1
|
@@ -3,8 +3,6 @@ require 'pact_broker/pacts/repository'
|
|
3
3
|
module PactBroker
|
4
4
|
module Pacts
|
5
5
|
describe Repository do
|
6
|
-
let(:td) { TestDataBuilder.new }
|
7
|
-
|
8
6
|
describe "find_wip_pact_versions_for_provider" do
|
9
7
|
let(:provider_tags) { %w[dev] }
|
10
8
|
let(:options) { { include_wip_pacts_since: include_wip_pacts_since } }
|
@@ -73,6 +71,28 @@ module PactBroker
|
|
73
71
|
end
|
74
72
|
end
|
75
73
|
|
74
|
+
context "when the latest pact for a tag has been successfully verified by the given provider tag but it was a WIP verification" do
|
75
|
+
before do
|
76
|
+
td.create_provider("bar")
|
77
|
+
.create_provider_version("333")
|
78
|
+
.create_provider_version_tag("dev")
|
79
|
+
.add_day
|
80
|
+
.create_pact_with_hierarchy("foo", "1", "bar")
|
81
|
+
.comment("above not included because it's not the latest dev")
|
82
|
+
.create_consumer_version("2")
|
83
|
+
.create_consumer_version_tag("feat-1")
|
84
|
+
.create_pact
|
85
|
+
.create_verification(wip: true, success: true, provider_version: "3", tag_names: %w[dev])
|
86
|
+
end
|
87
|
+
|
88
|
+
let(:provider_tags) { %w[dev] }
|
89
|
+
|
90
|
+
it "it is included" do
|
91
|
+
expect(subject[0].consumer_name).to eq "foo"
|
92
|
+
expect(subject[0].consumer_version_number).to eq "2"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
76
96
|
context "when the latest pact for a tag has been successfully verified by one of the given provider tags, but not the other" do
|
77
97
|
before do
|
78
98
|
td.create_provider("bar")
|
@@ -145,6 +165,8 @@ module PactBroker
|
|
145
165
|
end
|
146
166
|
end
|
147
167
|
|
168
|
+
|
169
|
+
|
148
170
|
context "when the latest pact for a tag has not been verified" do
|
149
171
|
before do
|
150
172
|
td.create_provider("bar")
|
@@ -23,7 +23,7 @@ module PactBroker
|
|
23
23
|
|
24
24
|
let(:options) { { webhook_execution_configuration: webhook_execution_configuration } }
|
25
25
|
let(:webhook_execution_configuration) { instance_double(PactBroker::Webhooks::ExecutionConfiguration) }
|
26
|
-
let(:params) { {'success' => true, 'providerApplicationVersion' => '4.5.6'} }
|
26
|
+
let(:params) { { 'success' => true, 'providerApplicationVersion' => '4.5.6', 'wip' => true, 'testResults' => { 'some' => 'results' }} }
|
27
27
|
let(:pact) do
|
28
28
|
td.create_pact_with_hierarchy
|
29
29
|
.create_provider_version('4.5.6')
|
@@ -33,14 +33,16 @@ module PactBroker
|
|
33
33
|
let(:create_verification) { subject.create 3, params, pact, options }
|
34
34
|
|
35
35
|
it "logs the creation" do
|
36
|
-
expect(logger).to receive(:info).with(/.*verification.*3
|
36
|
+
expect(logger).to receive(:info).with(/.*verification.*3/, payload: {"providerApplicationVersion"=>"4.5.6", "success"=>true, "wip"=>true})
|
37
37
|
create_verification
|
38
38
|
end
|
39
39
|
|
40
40
|
it "sets the verification attributes" do
|
41
41
|
verification = create_verification
|
42
|
+
expect(verification.wip).to be true
|
42
43
|
expect(verification.success).to be true
|
43
44
|
expect(verification.number).to eq 3
|
45
|
+
expect(verification.test_results).to eq 'some' => 'results'
|
44
46
|
end
|
45
47
|
|
46
48
|
it "sets the pact content for the verification" do
|
@@ -10,7 +10,7 @@ module PactBroker
|
|
10
10
|
describe Render do
|
11
11
|
describe "#call" do
|
12
12
|
before do
|
13
|
-
allow(PactBroker::Api::PactBrokerUrls).to receive(:
|
13
|
+
allow(PactBroker::Api::PactBrokerUrls).to receive(:pact_version_url_with_webhook_metadata).and_return("http://foo")
|
14
14
|
allow(PactBroker::Api::PactBrokerUrls).to receive(:verification_url) do | verification, base_url |
|
15
15
|
expect(verification).to_not be nil
|
16
16
|
"http://verification"
|
data/spec/spec_helper.rb
CHANGED
@@ -12,6 +12,7 @@ require 'rspec/pact/matchers'
|
|
12
12
|
require 'sucker_punch/testing/inline'
|
13
13
|
require 'webmock/rspec'
|
14
14
|
require 'pact_broker/policies'
|
15
|
+
require 'approvals/rspec'
|
15
16
|
|
16
17
|
Dir.glob("./spec/support/**/*.rb") { |file| require file }
|
17
18
|
|
@@ -19,6 +20,10 @@ WebMock.disable_net_connect!(allow_localhost: true)
|
|
19
20
|
|
20
21
|
I18n.config.enforce_available_locales = false
|
21
22
|
|
23
|
+
Approvals.configure do |c|
|
24
|
+
c.approvals_path = 'spec/fixtures/approvals/'
|
25
|
+
end
|
26
|
+
|
22
27
|
RSpec.configure do | config |
|
23
28
|
config.before :each do
|
24
29
|
PactBroker.reset_configuration
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.67.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Skurrie
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-10-
|
13
|
+
date: 2020-10-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -520,6 +520,7 @@ files:
|
|
520
520
|
- db/migrations/20200319_add_created_at_to_latest_verifications.rb
|
521
521
|
- db/migrations/20200922_add_event_to_triggered_webhook.rb
|
522
522
|
- db/migrations/20200930_update_latest_triggered_webhooks.rb
|
523
|
+
- db/migrations/20201006_add_wip_to_verification.rb
|
523
524
|
- db/migrations/migration_helper.rb
|
524
525
|
- db/test/backwards_compatibility/.rspec
|
525
526
|
- db/test/backwards_compatibility/Appraisals
|
@@ -1106,6 +1107,7 @@ files:
|
|
1106
1107
|
- spec/fixtures/a_consumer-a_provider-conflict.json
|
1107
1108
|
- spec/fixtures/a_consumer-a_provider-merged.json
|
1108
1109
|
- spec/fixtures/a_consumer-a_provider.json
|
1110
|
+
- spec/fixtures/approvals/modifiable_resources.approved.json
|
1109
1111
|
- spec/fixtures/certificate-invalid.pem
|
1110
1112
|
- spec/fixtures/certificate.pem
|
1111
1113
|
- spec/fixtures/certificates/cacert.pem
|
@@ -1178,7 +1180,9 @@ files:
|
|
1178
1180
|
- spec/lib/pact_broker/api/resources/badge_spec.rb
|
1179
1181
|
- spec/lib/pact_broker/api/resources/can_i_deploy_badge_spec.rb
|
1180
1182
|
- spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
|
1183
|
+
- spec/lib/pact_broker/api/resources/can_i_deploy_spec.rb
|
1181
1184
|
- spec/lib/pact_broker/api/resources/dashboard_spec.rb
|
1185
|
+
- spec/lib/pact_broker/api/resources/default_base_resource_approval_spec.rb
|
1182
1186
|
- spec/lib/pact_broker/api/resources/default_base_resource_spec.rb
|
1183
1187
|
- spec/lib/pact_broker/api/resources/error_handler_spec.rb
|
1184
1188
|
- spec/lib/pact_broker/api/resources/group_spec.rb
|
@@ -1497,6 +1501,7 @@ test_files:
|
|
1497
1501
|
- spec/fixtures/a_consumer-a_provider-conflict.json
|
1498
1502
|
- spec/fixtures/a_consumer-a_provider-merged.json
|
1499
1503
|
- spec/fixtures/a_consumer-a_provider.json
|
1504
|
+
- spec/fixtures/approvals/modifiable_resources.approved.json
|
1500
1505
|
- spec/fixtures/certificate-invalid.pem
|
1501
1506
|
- spec/fixtures/certificate.pem
|
1502
1507
|
- spec/fixtures/certificates/cacert.pem
|
@@ -1569,7 +1574,9 @@ test_files:
|
|
1569
1574
|
- spec/lib/pact_broker/api/resources/badge_spec.rb
|
1570
1575
|
- spec/lib/pact_broker/api/resources/can_i_deploy_badge_spec.rb
|
1571
1576
|
- spec/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_spec.rb
|
1577
|
+
- spec/lib/pact_broker/api/resources/can_i_deploy_spec.rb
|
1572
1578
|
- spec/lib/pact_broker/api/resources/dashboard_spec.rb
|
1579
|
+
- spec/lib/pact_broker/api/resources/default_base_resource_approval_spec.rb
|
1573
1580
|
- spec/lib/pact_broker/api/resources/default_base_resource_spec.rb
|
1574
1581
|
- spec/lib/pact_broker/api/resources/error_handler_spec.rb
|
1575
1582
|
- spec/lib/pact_broker/api/resources/group_spec.rb
|