Skip to content

Commit

Permalink
test: add more specs to integration tests (#766)
Browse files Browse the repository at this point in the history
Co-authored-by: Phanindra Srungavarapu <[email protected]>
  • Loading branch information
pahnin and Phanindra Srungavarapu authored Feb 13, 2025
1 parent cf3e55b commit 4048016
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions spec/lib/pact_broker/integrations/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

module PactBroker
module Integrations
describe "#find_for_provider" do
before do
td.create_pact_with_hierarchy("Foo", "1", "Bar")
.create_pact_with_hierarchy("Foo", "2", "Bar")
.create_pact_with_hierarchy("Foo", "3", "Waffle")
.create_pact_with_hierarchy("Foo", "4", "Dog")
end

let(:provider) { PactBroker::Domain::Pacticipant.find_by_name("Bar").single_record }

subject { Service.find_for_provider(provider) }

it "returns the integrations for the provider" do
expect(subject.size).to eq 1
end

it "has the correct consumer names" do
expect(subject.collect(&:consumer_name)).to eq ["Foo"]
end

it "has the correct provider names" do
expect(subject.collect(&:provider_name)).to eq ["Bar"]
end
end

describe Service do
describe "#delete" do
subject { Service.delete("Foo", "Bar") }
Expand Down

0 comments on commit 4048016

Please sign in to comment.