0

I have cucumber(with capybara) scenarios, which use gmaps4rails gem, thus some steps call gmaps external API during test's execution. I wanna stub out these calls. What is the best way to achieve that? Thanks in advance!

Paul Osadchiy
  • 169
  • 1
  • 6

1 Answers1

0

I've found the solution and it's pretty straightforward. In specs I just stubbed Gmaps4rails.should_receive(:geocode), and in Cucumber scenarios I used webmock gem: call to URL is stubbed in basic_steps.rb and json responses (files with .json extensions) are placed to test/fixtures.

Paul Osadchiy
  • 169
  • 1
  • 6