From c45f3e48ba475a33b4a9eb4186c3dd24e4dc7d01 Mon Sep 17 00:00:00 2001 From: bangn Date: Tue, 22 Jun 2021 19:10:04 +1000 Subject: [PATCH] Pass the hash explicitly to Sequel.| method Otherwise it will become and AND operator instead of OR operator. --- lib/pact_broker/index/service.rb | 4 ++-- spec/lib/pact_broker/pacticipants/repository_spec.rb | 4 ++-- spec/lib/pact_broker/ui/controllers/index_spec.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pact_broker/index/service.rb b/lib/pact_broker/index/service.rb index e96d00871..371433fe0 100644 --- a/lib/pact_broker/index/service.rb +++ b/lib/pact_broker/index/service.rb @@ -147,8 +147,8 @@ def self.head_pact_publications(options = {}) if options[:pacticipant_name] pacticipant_ids = pact_pacticipant_ids_by_name(options[:pacticipant_name]) base = base.where(Sequel.|( - Sequel[:pact_publications][:consumer_id] => pacticipant_ids, - Sequel[:pact_publications][:provider_id] => pacticipant_ids + { Sequel[:pact_publications][:consumer_id] => pacticipant_ids }, + { Sequel[:pact_publications][:provider_id] => pacticipant_ids } )) # Return early if there is no pacticipant matches the input name diff --git a/spec/lib/pact_broker/pacticipants/repository_spec.rb b/spec/lib/pact_broker/pacticipants/repository_spec.rb index 27864521f..78ff9d341 100644 --- a/spec/lib/pact_broker/pacticipants/repository_spec.rb +++ b/spec/lib/pact_broker/pacticipants/repository_spec.rb @@ -194,8 +194,8 @@ module Pacticipants end describe "#search_by_name" do - let(:consumer_name) { "This is_a test consumer" } - let(:provider_name) { "and a test provider" } + let(:consumer_name) { "This is_a test-consumer" } + let(:provider_name) { "and a test/provider" } before do td diff --git a/spec/lib/pact_broker/ui/controllers/index_spec.rb b/spec/lib/pact_broker/ui/controllers/index_spec.rb index 39e76f8ff..287bfe0cd 100644 --- a/spec/lib/pact_broker/ui/controllers/index_spec.rb +++ b/spec/lib/pact_broker/ui/controllers/index_spec.rb @@ -106,7 +106,7 @@ module Controllers context "when it is NOT blank and the pacticipant name exists" do it "returns the pacticipant which matches the query" do - get "/", { pacticipant_name: "example app" } + get "/", { pacticipant_name: "app" } expect(last_response.body).to include("Example App") expect(last_response.status).to eq(200)