application route's model hook not triggering in qunit integration test

南楼画角 提交于 2019-12-25 06:58:16

问题


I have a route that looks like this:

App.ApplicationRoute = Ember.Route.extend({
  model: function() {
    console.log("caching books");
    this.store.find('books');
  }
});

When I run it locally I see the "caching books" message in the console. But when I run it in qunit the message never shows up.

Why does the application route's model hook not fire in qunit?

Here's my qunit integration test:

module('Ember.js Library', {
  setup: function() {
    Ember.run(App, App.advanceReadiness);
  },
  teardown: function() {
    App.reset();
  }
});

test('root url redirects to leads list', function() {
  visit('/');
  andThen(function() {
    // assert
  });
});

来源:https://stackoverflow.com/questions/27351221/application-routes-model-hook-not-triggering-in-qunit-integration-test

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!