Search code examples
ruby-on-railsrspecfactory-botrspec-railshttp-mock

How to test active resource like models?


I am using a gem called spyke for my rails models. Spyke is similar to active resource and uses JSON API as data source. I want to write tests using rspec and factory girl.

How can I set up a mock data source for testing? So far I have found httpmock which is part of active_resource, I am looking for something similar, preferably an independent gem/library.


Solution

  • Checkout webmock, fakeweb, vcr, pact(your own api only)