Ember.js 运行循环中Ember数据模型的集成测试

Ember.js 运行循环中Ember数据模型的集成测试,ember.js,Ember.js,我想使用visithelper来测试以下路径: App.IndexRoute = Em.Route.extend model: -> App.Movies.find "The Godfather" 但我的测试没有通过,我得到: assertion failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code

我想使用
visit
helper来测试以下路径:

App.IndexRoute = Em.Route.extend
    model: ->
        App.Movies.find "The Godfather"
但我的测试没有通过,我得到:

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 an Ember.run
不幸的是,像这样包装它并没有帮助:

App.IndexRoute = Em.Route.extend
    model: ->
        Em.run =>
            App.Movies.find "The Godfather"
(我还包装了
@App=Em.Application.create()

将代码包装到运行循环中的正确方法是什么


我正在使用带有Karma的
rc.5

如何为测试构建数据?应该将该部分(或设置属性)包装在Ember.run中

使用FixtureAdapter,您应该有如下内容:

Ember.run(function() {
  App.Movie.FIXTURES=[{ name: "the Godfather" }, { name: "Apocalypse Now" }];
});

如何为测试构建数据?应该将该部分(或设置属性)包装在Ember.run中

使用FixtureAdapter,您应该有如下内容:

Ember.run(function() {
  App.Movie.FIXTURES=[{ name: "the Godfather" }, { name: "Apocalypse Now" }];
});

事实证明,我试图从中获取数据的服务器返回了一个404,这导致Ember断言

在修复服务器端id之后,结果证明根本不需要
Em.run()


查看GitHub了解更多信息:

结果是,我试图从中获取数据的服务器返回了一个404,这导致Ember断言

在修复服务器端id之后,结果证明根本不需要
Em.run()

有关更多信息,请参阅GitHub: