Skip to content

Commit

Permalink
test: update
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 12, 2021
1 parent 48068d2 commit 3dbfea6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ module Contracts
end

it "is valid" do
params = { consumerVersionSelectors: [selector] }
params = { consumerVersionSelectors: [selector], providerVersionBranch: "main" }
expect(PactsForVerificationJSONQuerySchema.(params)).to be_empty
end

extra_keys = ALL_PROPERTIES.keys - valid_key_combination - [:consumer]
extra_keys.each do | extra_key |
selector_with_extra_key = selector.merge(extra_key => ALL_PROPERTIES[extra_key])
expect_to_be_valid = !!VALID_KEY_COMBINATIONS.find{ | k | k.sort == selector_with_extra_key.keys.sort }
params = { consumerVersionSelectors: [selector_with_extra_key] }
params = { consumerVersionSelectors: [selector_with_extra_key], providerVersionBranch: "main" }

describe "with #{selector_with_extra_key}" do
if expect_to_be_valid
Expand All @@ -73,7 +73,7 @@ module Contracts

describe "with #{selector_with_consumer}" do
it "is valid" do
params = { consumerVersionSelectors: [selector_with_consumer] }
params = { consumerVersionSelectors: [selector_with_consumer], providerVersionBranch: "main" }

expect(PactsForVerificationJSONQuerySchema.(params).empty?).to be true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module Contracts
}]
end

subject { PactsForVerificationJSONQuerySchema.(params).tap { |it| puts it } }
subject { PactsForVerificationJSONQuerySchema.(params) }

context "when the params are valid" do
it "has no errors" do
Expand Down

0 comments on commit 3dbfea6

Please sign in to comment.