Pedro Adame Vergara
Pedro Adame Vergara

Reputation: 592

Rails mock call FROM external web service?

I've seen a lot of posts of how to mock external service requests during tests to improve test suite's speed and make them functional even without connection using gems like Webmock or VCR.

Now I have a route that gets called FROM an external service. i.e the external service POSTs to my app. How could I mock that?

Upvotes: 0

Views: 168

Answers (1)

Hoa
Hoa

Reputation: 3207

Now I have a route that gets called FROM an external service. i.e the external service POSTs to my app.

This means your application provides a public API through one of your controller. To test the public API, you simply test the corresponding action in your controller as you always do when testing controllers.

Here's a reference.

Upvotes: 1

Related Questions