9
有沒有人有任何好的建議,測試燼路由connectOutlets已成功?測試ember.js connectOutlet
例如,我有以下途徑:
vault: Ember.Route.extend
route: '/vault'
connectOutlets: (router, event) ->
router.get('applicationController').connectOutlet 'exercises'
index: Ember.Route.extend
route: '/'
connectOutlets: (router, event) ->
exercises = WZ.store.find(WZ.Exercise)
router.get('exercisesController').connectOutlet 'main', 'exercisesHome', exercises
我怎麼會去檢查,這是具有所期望的行爲?
我可以測試currentState.path這樣的:
it 'should transition to vault', ->
Ember.run =>
@router.transitionTo 'vault'
expect(@router.getPath('currentState.path')).toEqual 'root.vault'
但我不認爲這是一個很好的考驗。