Skip to content

Commit

Permalink
feat: update expectation of error response
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Jun 15, 2018
1 parent e1ec885 commit d45244f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion doc/pacts/markdown/Pact Broker Client - Pact Broker.md
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,9 @@ Pact Broker will respond with:
"Content-Type": "application/hal+json"
},
"body": {
"message": "An error occurred"
"error": {
"message": "An error occurred"
}
}
}
```
Expand Down
6 changes: 4 additions & 2 deletions spec/pacts/pact_broker_client-pact_broker.json
Original file line number Diff line number Diff line change
Expand Up @@ -804,14 +804,16 @@
"Content-Type": "application/hal+json"
},
"body": {
"message": "An error occurred"
"error": {
"message": "An error occurred"
}
},
"matchingRules": {
"$.headers.Content-Type": {
"match": "regex",
"regex": "application\\/.*json"
},
"$.body.message": {
"$.body.error.message": {
"match": "regex",
"regex": ".*"
}
Expand Down
7 changes: 6 additions & 1 deletion spec/service_providers/pact_broker_client_publish_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require 'pact_broker/client/pact_broker_client'
require_relative 'pact_helper'

module PactBroker::Client
describe PactBrokerClient, :pact => true do

Expand Down Expand Up @@ -116,7 +119,9 @@ module PactBroker::Client
status: 500,
headers: {'Content-Type' => Pact.term(generate: 'application/hal+json', matcher: %r{application/.*json})},
body: {
message: Pact::Term.new(matcher: /.*/, generate: 'An error occurred')
error: {
message: Pact::Term.new(matcher: /.*/, generate: 'An error occurred')
}
}
)
end
Expand Down

0 comments on commit d45244f

Please sign in to comment.