Closed peco8 closed 7 years ago
@peco8 I'm having the same issue, same code in in routes file. Did you fix this?
@Hatcher19
Hi I could fixed this problem.
Actually this is not specific for Stripe_event gem.
Under config/environments/test.rb
, please check the following option:
#Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
By default, this option is set to false, which will raise the exception instead of rendering the template.
Your test assumes that the template will be rendered even if an exception is raised.
You can do
config.action_dispatch.show_exceptions = true
Alternatively, if you don't want to change this value you can write the following test:
expect {
post '/hogehoge', {}
}.to raise_error(ActionController::RoutingError)
Hello @peco8! I'm a bit confused about why your tests are using /stripe-hogehoge
when you've specified /stripe-events
in your routes.rb file. What is the behavior under test? What do you expect to be the result of the test?
I'm happy to help but need some more clarity on what you're trying to accomplish. Cheers!
Would you mind closing the issue if you've resolved it on your end?
I've been writing mock tests with RSpec. The problem is the end point I specified doesn't seem to accept the POST request within CircleCI container. (The test works fine locally.)
In config/routes.rb
I use