outmoded / discuss

The "mailing list"
99 stars 9 forks source link

Stubbing pre handlers #792

Closed barbaracassani closed 5 years ago

barbaracassani commented 5 years ago

I am writing a complex route that it's made more manageable by splitting it in pre handlers. One to gather data from the db, one to validate the data, one to post the data to an external service, and so on.

It would be awesome if I could stub each pre separately in test, so I could test what happens to the route lifecycle as a whole if for example the data is not valid, etc. I have fiddled around an hour or two but there seems no way to do so. Any idea?

hueniverse commented 5 years ago

answered in Slack.