forked from pact-foundation/pact_broker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure latest verification is loaded on pact object before execu…
…ting webhook This fixes the bug where the githubVerificationStatus was being calculated as 'pending' when a pact with the same content as a previously verified one was republished.
- Loading branch information
Showing
5 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'pact_broker/domain/pact' | ||
|
||
module PactBroker | ||
module Domain | ||
describe Pact do | ||
describe "latest_verification" do | ||
context "when it has been set to an object" do | ||
subject { Pact.new(latest_verification: 'verification') } | ||
|
||
its(:latest_verification) { is_expected.to eq 'verification' } | ||
end | ||
|
||
context "when it has been set to nil" do | ||
subject { Pact.new(latest_verification: nil) } | ||
|
||
its(:latest_verification) { is_expected.to eq nil } | ||
end | ||
|
||
context "when it has not been set" do | ||
it "raises an error" do | ||
expect { Pact.new.latest_verification.foo }.to raise_error UnsetAttributeError | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters