I am writing an app that access a local that lives on a separate path on my own server via ajax requests. However, I want to test the app with cucumber and mock out the backend. Is there something like artiface or sham_rack that 开发者_StackOverflowwould let me do this?
I'd recommend using VCR:
http://relishapp.com/myronmarston/vcr
It allows you to record the requests to the external service once, and then play back the recorded responses when running your tests.
I use MockJson to simulate the response: MockJson website
How about something like http://fakeweb.rubyforge.org/?
精彩评论