Skip to content

Commit

Permalink
Added header mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque authored and YOU54F committed Aug 15, 2024
1 parent 1874b7f commit a61466f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion consumer/spec/bar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
upon_receiving("a retrieve thing request").with({
method: :get,
path: '/thing',
headers: {'Accept' => 'application/json'}
headers: {'Accept' => Pact.term(/application\/.*json/, "application/json")}
}).
will_respond_with({
status: 200,
Expand Down
6 changes: 6 additions & 0 deletions consumer/spec/pacts/foo-bar.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"path": "/thing",
"headers": {
"Accept": "application/json"
},
"matchingRules": {
"$.headers.Accept": {
"match": "regex",
"regex": "application\\/.*json"
}
}
},
"response": {
Expand Down
2 changes: 1 addition & 1 deletion provider/bar_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class BarApp
def call env
status = 200
headers = {'Content-Type' => 'application/json'}
headers = {'Content-Type' => 'application/jsonish'}
body = {
thing: [1],
array: [1, 2, 3],
Expand Down

0 comments on commit a61466f

Please sign in to comment.