Skip to content

Commit

Permalink
Pass the hash explicitly to Sequel.| method
Browse files Browse the repository at this point in the history
Otherwise it will become and AND operator instead of OR operator.
  • Loading branch information
bangn committed Jun 22, 2021
1 parent dedad6d commit c45f3e4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/pact_broker/index/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/pact_broker/pacticipants/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/pact_broker/ui/controllers/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c45f3e4

Please sign in to comment.