From ac2bfe95a894f3d01fe89c8a70049edd010bbebd Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 3 Sep 2021 18:43:43 +1000 Subject: [PATCH] refactor: rename VerifiablePactsQueryDecorator to PactsForVerificationQueryDecorator --- ...corator.rb => pacts_for_verification_query_decorator.rb} | 2 +- .../api/resources/provider_pacts_for_verification.rb | 4 ++-- ...ec.rb => pacts_for_verification_query_decorator_spec.rb} | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) rename lib/pact_broker/api/decorators/{verifiable_pacts_query_decorator.rb => pacts_for_verification_query_decorator.rb} (97%) rename spec/lib/pact_broker/api/decorators/{verifiable_pacts_query_decorator_spec.rb => pacts_for_verification_query_decorator_spec.rb} (96%) diff --git a/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator.rb b/lib/pact_broker/api/decorators/pacts_for_verification_query_decorator.rb similarity index 97% rename from lib/pact_broker/api/decorators/verifiable_pacts_query_decorator.rb rename to lib/pact_broker/api/decorators/pacts_for_verification_query_decorator.rb index 470bd507b..6e9dc37c2 100644 --- a/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator.rb +++ b/lib/pact_broker/api/decorators/pacts_for_verification_query_decorator.rb @@ -8,7 +8,7 @@ module PactBroker module Api module Decorators - class VerifiablePactsQueryDecorator < BaseDecorator + class PactsForVerificationQueryDecorator < BaseDecorator using PactBroker::HashRefinements collection :provider_version_tags, default: [] diff --git a/lib/pact_broker/api/resources/provider_pacts_for_verification.rb b/lib/pact_broker/api/resources/provider_pacts_for_verification.rb index 371df15ec..f474984f3 100644 --- a/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +++ b/lib/pact_broker/api/resources/provider_pacts_for_verification.rb @@ -1,7 +1,7 @@ require "pact_broker/api/resources/provider_pacts" require "pact_broker/api/decorators/verifiable_pacts_decorator" require "pact_broker/api/contracts/pacts_for_verification_query_string_schema" -require "pact_broker/api/decorators/verifiable_pacts_query_decorator" +require "pact_broker/api/decorators/pacts_for_verification_query_decorator" require "pact_broker/api/contracts/pacts_for_verification_json_query_schema" require "pact_broker/hash_refinements" @@ -76,7 +76,7 @@ def query_schema end def parsed_query_params - @parsed_query_params ||= decorator_class(:verifiable_pacts_query_decorator).new(OpenStruct.new).from_hash(query) + @parsed_query_params ||= decorator_class(:pacts_for_verification_query_decorator).new(OpenStruct.new).from_hash(query) end def query diff --git a/spec/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator_spec.rb b/spec/lib/pact_broker/api/decorators/pacts_for_verification_query_decorator_spec.rb similarity index 96% rename from spec/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator_spec.rb rename to spec/lib/pact_broker/api/decorators/pacts_for_verification_query_decorator_spec.rb index e912d83eb..49a9e128c 100644 --- a/spec/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator_spec.rb +++ b/spec/lib/pact_broker/api/decorators/pacts_for_verification_query_decorator_spec.rb @@ -1,14 +1,14 @@ -require "pact_broker/api/decorators/verifiable_pacts_query_decorator" +require "pact_broker/api/decorators/pacts_for_verification_query_decorator" module PactBroker module Api module Decorators - describe VerifiablePactsQueryDecorator do + describe PactsForVerificationQueryDecorator do let(:provider_version_tags) { %w[dev] } let(:provider_version_branch) { "main" } - subject { VerifiablePactsQueryDecorator.new(OpenStruct.new).from_hash(params) } + subject { PactsForVerificationQueryDecorator.new(OpenStruct.new).from_hash(params) } context "when parsing JSON params" do let(:params) do