Skip to content

Stubbing out calls to external systems

Ashley Engelund edited this page Nov 2, 2017 · 2 revisions

Note: We are working through and deciding this right now. Add any ideas or thoughts or considerations so we can come up with good, thorough guidelines.

Our system communicates with other systems through webhooks and APIs, etc.

Our guidelines for communicating with these systems during testing are ..... (what?)

In unit (RSpec) tests:

  • Since the purpose of unit tests is to test the internals of something (an object, area, etc.), the focus is not on how it communicates with external items.
  • external communication should be "mocked" or "stubbed" out, e.g. with VCR, etc.

During integration (cucumber) tests:

  • most of the time

What are examples of times when it is critical to communicate with an external system?

  • when we must meet a specification about the amount of time our system waits for a response from an external system Can this be mocked or stubbed most of the time? all of the time?
  • performance (e.g. how long we expect a user to wait until they see something happen) Can this be mocked or stubbed most of the time? all of the time?
Clone this wiki locally