Closed hsaab closed 4 years ago
I would say your route doesn't exist :P
I haven't used Rails for many many years, so I'm not sure how much help I can provide. One thing I noticed is scope module: :v1,
. Does that put a /v1
prefix in the route?
haha. Thanks @bethesque, that's a good idea - I played a bit with different route combinations but turns out the original route was right.
The fix was not opting out of the config.ru
and setting one up within the api
directory (where rake pact:verify
was run). If anyone runs in to the same issue, try to set up the config.ru
first (as the docs describe)!
I do have one question @bethesque . Is there a way to configure the config.ru
path that pact looks for when running rake pact:verify
? Couldn't find too much on that within the docs
Yes, you can set the config.ru path on the configuration object
This line here shows how you can parse the app out of the config.ru file https://github.com/pact-foundation/pact-ruby/blob/55bb93584b26619952bd251a0e8fe079f39555a7/lib/pact/provider/configuration/service_provider_dsl.rb#L24
Thank you for your help! @bethesque
Hello! I am trying to set up pact (1.32.0) in a rails app (v 4.2.11.3). I've gotten all the way to the point where I have the
pact_helper.rb
file setup and when runningrake pact:verify
, I can see the contract from the consumer is being tested against.The issue I have is that I have the route of the interaction setup in my
config/routes.rb
file but I'm not sure why I'm getting a 404 in the test. It's almost like pact is telling me the route doesn't exist. I'll attach the relevant files below and any assistance would be much appreciated :)Error I'm getting
pact_helper.rb
config/routes.rb
dummy/config/routes.rb
contract/order_web-gravy.json
Pact log file