Skip to content

Options for mocking 3rd party services to avoid network calls (from the Rails code) ? #160

@galori

Description

@galori

I saw the other issue asking about getting VCR working, and it's likely requirement for running Puma single threaded.

What are the other options in this context? Possibilities:

  1. "test mode" in each client library
  2. WebMock?
  3. Using RSpec mocks?
  4. Use standalone service HTTP server or proxy to respond with fake responses
  5. Any other options? What is everyone else doing?

Option 1: Doesn't work for my use case (we integrate with hundreds of 3rd party libraries).
Option 2: Could WebMock work? Would it need to be run in single thread mode like VCR?
Option 3: Could be interesting but also clunky. Might require RSpec to launch Cypress from within examples, similar to how Capybara works
Option 4: Any recommendation? I found http-mock-server but it has been archived. mock-server seems neat and feature complete but requires java (would like to avoid introducing new tech) and also seems fairly "heavy".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions