Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
galori opened this issue Feb 9, 2024 · 0 comments

Comments

@galori
Copy link

galori commented Feb 9, 2024

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant