Ember.RSVP.hash和验收测试

时间:2015-11-11 18:15:38

标签: ember.js ember-cli

我有一个从服务调用的哈希:

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中,但这不起作用。

在验收测试中运行哈希的最佳方法是什么?

0 个答案:

没有答案