Skip to content

Instantly share code, notes, and snippets.

@thisismydesign
Last active September 2, 2021 22:05
Show Gist options
  • Save thisismydesign/ebe6b7677ac06979627e16b8226c72dc to your computer and use it in GitHub Desktop.
Save thisismydesign/ebe6b7677ac06979627e16b8226c72dc to your computer and use it in GitHub Desktop.
Ruby: Use factories for your webmocks /2
stub_request(:get, %r{#{ENV['XYZ_SERVICE_SERVER']}/api/v2/get_entities*})
.to_return(build(:xyz_service_get_entities_response))
allow(XyzService).to receive(:get_entities).and_return(build(:xyz_service_get_entities_response))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment