From ebbbbec9d9838a3877f669a3fd4b46ff1c6a828b Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Thu, 21 Nov 2019 16:43:59 +1100 Subject: [PATCH] feat(pacts for verification): make latest flag required and true for now, until the 'all pacts for tag' is implemented --- .../api/contracts/verifiable_pacts_json_query_schema.rb | 2 +- .../api/contracts/verifiable_pacts_query_schema.rb | 2 +- .../api/contracts/verifiable_pacts_json_query_schema_spec.rb | 4 +--- .../api/contracts/verifiable_pacts_query_schema_spec.rb | 4 +--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema.rb b/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema.rb index 0f19cfddd..b8d450472 100644 --- a/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema.rb +++ b/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema.rb @@ -18,7 +18,7 @@ class VerifiablePactsJSONQuerySchema optional(:consumerVersionSelectors).each do schema do required(:tag).filled(:str?) - optional(:latest).filled(included_in?: [true, false]) + required(:latest).filled(included_in?: [true]) end end optional(:includePendingStatus).filled(included_in?: [true, false]) diff --git a/lib/pact_broker/api/contracts/verifiable_pacts_query_schema.rb b/lib/pact_broker/api/contracts/verifiable_pacts_query_schema.rb index 55e48823f..3e5b77110 100644 --- a/lib/pact_broker/api/contracts/verifiable_pacts_query_schema.rb +++ b/lib/pact_broker/api/contracts/verifiable_pacts_query_schema.rb @@ -17,7 +17,7 @@ class VerifiablePactsQuerySchema optional(:consumer_version_selectors).each do schema do required(:tag).filled(:str?) - optional(:latest).filled(included_in?: ["true", "false"]) + required(:latest).filled(included_in?: ["true"]) end end optional(:include_pending_status).filled(included_in?: ["true", "false"]) diff --git a/spec/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema_spec.rb b/spec/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema_spec.rb index 4aa61002f..86c6fb4ef 100644 --- a/spec/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema_spec.rb +++ b/spec/lib/pact_broker/api/contracts/verifiable_pacts_json_query_schema_spec.rb @@ -57,9 +57,7 @@ module Contracts }] end - it "has no errors" do - expect(subject).to eq({}) - end + it { is_expected.to have_key(:consumerVersionSelectors) } end context "when includeWipPactsSince key exists" do diff --git a/spec/lib/pact_broker/api/contracts/verifiable_pacts_query_schema_spec.rb b/spec/lib/pact_broker/api/contracts/verifiable_pacts_query_schema_spec.rb index ac24119f2..163bb5d72 100644 --- a/spec/lib/pact_broker/api/contracts/verifiable_pacts_query_schema_spec.rb +++ b/spec/lib/pact_broker/api/contracts/verifiable_pacts_query_schema_spec.rb @@ -51,9 +51,7 @@ module Contracts }] end - it "has no errors" do - expect(subject).to eq({}) - end + it { is_expected.to have_key(:consumer_version_selectors) } end context "when include_wip_pacts_since key exists" do