开发者

Mocking local api in cucumber tests

开发者 https://www.devze.com 2023-03-24 05:51 出处:网络
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 lik

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/?

0

精彩评论

暂无评论...
验证码 换一张
取 消