Mocking HTTP requests in ember-qunit
问题 In an ember-cli app, testing is done using ember-qunit. I would like to mock HTTP requests, but have not been able to find a recommended way of doing this in the documentation. I have found this thread which discusses this, but it appears to be out of date (for ember-cli anyway). How do you mock HTTP requests? 回答1: This is how I mock HTTP requests. One improvement could be done by encapsulating mockjax with helper like: function stubEndpointForHttpRequest(url, json) { $.mockjax({ url: url,