在 Ember.js 1.0.rc1 上使用 Konacha 进行集成测试时遇到问题。我的问题是所有测试都在呈现任何视图之前运行。有没有办法知道什么时候所有的东西都已经渲染了,而不需要手动超时?
规范助手:
//=require sinon
//=require jquery
//=require jquery_ujs
//=require twitter/bootstrap
//=require handlebars
//=require ember
//=require ember-data
//=require_self
//=require icarium
window.lookupController = (name) ->
Icarium.__container__.lookup('controller:' + name)
window.currentPath = ->
lookupController('application').get('currentPath')
Ember.testing = true
Ember.run ->
window.Icarium = Ember.Application.create()
考试:
//=require spec_helper
describe "user login", ->
before (done) ->
Ember.run ->
Icarium.set 'ready', ->
done()
Icarium.initialize()
afterEach ->
Ember.run ->
Icarium.reset()
it "routes to login", ->
Ember.run ->
currentPath().should.eq "login"
it "renders the login form", ->
$('input[type=password]').should.exist