Pact is a cross-language tool that provides Consumer Driven Contracts testing.
Questions tagged [pact-ruby]
8 questions
2
votes
2 answers
How do I verify pacts against an API that requires an auth token?
I'm using the Pact gem (and loving it!) for my contract test suite. The API service I'm testing requires an authorization token for all requests.
I know how to generate an API token for my user, but I don't know where to place the token in the Pact…

mycargus
- 2,538
- 3
- 23
- 31
2
votes
1 answer
Cygwin packages not workiing after installing with pact on Babun (Windows 10)
Same as https://github.com/babun/babun/issues/702
I first noticed this when I installed pact install dig. which dig returns the binary's location, but it does nothing:
{ ~ } » dig github.com …

Jorge Orpinel Pérez
- 6,361
- 1
- 21
- 38
1
vote
1 answer
Pact::JsonDiffer not behaving as expected with pact-messages gem
I'm using the pact-messages gem to generate a Pact file for a consumer of an events message queue provider.
Here's the Pact file:
{
"consumer": {
"name": "Ice Cream"
},
"provider": {
"name": "Desserts"
},
"interactions": [{
…

mycargus
- 2,538
- 3
- 23
- 31
0
votes
1 answer
Pact verification: Failure/Error: expect(header_value).to match_header(name, expected_header_value)
Using pact to verify if the response header matches for the consumer and provider.
Running the pact verification on the provider side gives me the following error:
Failure/Error: expect(header_value).to match_header(name,…

user8901251
- 43
- 4
0
votes
2 answers
Encoded / Encrypted body before verifying a Pact
A server I need to integrate with returns its answers encoded as a JWT. Worse, the response body actually is a json, of the form:
{d: token} with token = JWT.encode({id: 123, field: "John", etc.})
I'd like to use a pact verification on the…

André
- 1
0
votes
1 answer
Extract the exact value used in a PACT (when the match is done via a regexp as value not initially known))
I have a ruby pact mock service provider that captures my request. I would like to extract the exact value provided in the request (which was matched by a Pact.term / Pact.like), to do further processing with that value once the request has been…

André
- 1
0
votes
0 answers
How to mock user authentication on Rails with Pact contract verification?
On a Pact verification stage I need to mock user authentication. What is the best way to do it?
I'm using Rails 4 with Devise.
I found a very hacky looking solution, which works but looks ugly and I hope there's another way to do it.
I'm replacing…

Vladimir Mikhaylovskiy
- 1,955
- 4
- 19
- 28
0
votes
1 answer
Running Pact against test environment in Rails API
Just playing around with Pact against my Rails API and noticed that the out-of-the-box Pact setup runs against the "development" environment by default.
How do I configure to run against the "test" environment without having to specify it in…

Mo Jaimangal
- 63
- 6