我有一个从服务调用的哈希:
return new Ember.RSVP.hash({
locations: ajax(
{
url: applicationConfig.apiUrl + '/api/v1/locations/search?term=' + term
}),
listingEvents: ajax({
url: applicationConfig.apiUrl + '/api/v1/listingevents/search?term=' + term
})
});
现在在我的测试中我得到了:
✘ Error: Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun.
You will need to wrap any code with asynchronous side-effects in a run
我已将哈希包装在Ember.run
中,但这不起作用。
在验收测试中运行哈希的最佳方法是什么?