From 661f91cd5bf73ebd8154cfaf2ae7b65a457f9caf Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Wed, 11 Aug 2021 17:22:03 +1000 Subject: [PATCH] test: update matrix spec --- .../approvals/matrix_integration_spec.approved.txt | 6 +----- spec/lib/pact_broker/matrix/integration_spec.rb | 14 ++++++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/spec/fixtures/approvals/matrix_integration_spec.approved.txt b/spec/fixtures/approvals/matrix_integration_spec.approved.txt index c0aeb606f..364f079f5 100644 --- a/spec/fixtures/approvals/matrix_integration_spec.approved.txt +++ b/spec/fixtures/approvals/matrix_integration_spec.approved.txt @@ -13,21 +13,18 @@ PactBroker::Matrix::Service find find returns a QueryResultsWithDeploymentStatus PactBroker::Matrix::Service find when deploying a consumer that has not been verified by any providers returns 2 integrations: deployable: reasons: - - PactBroker::Matrix::NoEnvironmentSpecified - PactBroker::Matrix::PactNotEverVerifiedByProvider - PactBroker::Matrix::PactNotEverVerifiedByProvider ? PactBroker::Matrix::Service find when deploying a consumer that has not been verified - by any providers but cannot resolve selectors for the providers + by any providers it creates selectors for the providers : deployable: reasons: - - PactBroker::Matrix::NoEnvironmentSpecified - PactBroker::Matrix::PactNotEverVerifiedByProvider - PactBroker::Matrix::PactNotEverVerifiedByProvider ? PactBroker::Matrix::Service find when deploying a consumer that has not been verified by any providers does not allow the consumer to be deployed : deployable: reasons: - - PactBroker::Matrix::NoEnvironmentSpecified - PactBroker::Matrix::PactNotEverVerifiedByProvider - PactBroker::Matrix::PactNotEverVerifiedByProvider ? 'PactBroker::Matrix::Service find when deploying a consumer that has two providers @@ -59,7 +56,6 @@ PactBroker::Matrix::Service find when deploying a consumer that has not been ver to be deployed : deployable: true reasons: - - PactBroker::Matrix::NoEnvironmentSpecified - PactBroker::Matrix::Successful PactBroker::Matrix::Service find when the specified version does not exist does not allow the app to be deployed: deployable: false diff --git a/spec/lib/pact_broker/matrix/integration_spec.rb b/spec/lib/pact_broker/matrix/integration_spec.rb index 4b6664d54..8b1857e9f 100644 --- a/spec/lib/pact_broker/matrix/integration_spec.rb +++ b/spec/lib/pact_broker/matrix/integration_spec.rb @@ -81,12 +81,16 @@ module Matrix [ UnresolvedSelector.new(pacticipant_name: "Foo", pacticipant_version_number: "1") ] end + let(:options) do + { latest: true, tag: "prod", latestby: "cvp" } + end + it "returns 2 integrations" do expect(subject.integrations.size).to eq 2 end - it "but cannot resolve selectors for the providers" do - expect(subject.resolved_selectors.size).to eq 1 + it "it creates selectors for the providers" do + expect(subject.resolved_selectors.size).to eq 3 end it "does not allow the consumer to be deployed" do @@ -111,7 +115,7 @@ module Matrix [ UnresolvedSelector.new(pacticipant_name: "Foo", pacticipant_version_number: "3.0.0") ] end - let(:options) { {latest: true, tag: "prod", latestby: "cvp"} } + let(:options) { { latest: true, tag: "prod", latestby: "cvp" } } it "returns 2 integrations" do expect(subject.integrations.size).to eq 2 @@ -133,7 +137,7 @@ module Matrix describe "when deploying an old version of a consumer that has added a new provider since that version" do before do td.create_pact_with_hierarchy("Foo", "1", "Bar") - .create_verification(provider_version: "2") + .create_verification(provider_version: "2", tag_names: ["prod"]) .create_consumer_version("2") .create_pact .create_verification(provider_version: "3") @@ -146,6 +150,8 @@ module Matrix [ UnresolvedSelector.new(pacticipant_name: "Foo", pacticipant_version_number: "1") ] end + let(:options) { { latest: true, tag: "prod", latestby: "cvp" } } + it "allows the old version of the consumer to be deployed" do expect(subject.deployment_status_summary).to be_deployable end