More cleanup between tests to avoid Metamorph errors
It seems that store is not automatically cleaned when calling app.destroy() as this is just regular property on app object. Furthermore, there is a bug with connectOutlet that prevents cleaning views that are set with it. I've added a small hack to save all the views added as outlets to be able to clean them after running tests.
This commit is contained in:
parent
4a15ccde32
commit
05ee9938a9
|
@ -13,6 +13,19 @@ Travis.reopen
|
|||
@connectOutlet(outletName: 'top', controller: @topController, viewClass: Travis.TopView)
|
||||
@topController.set('tab', @get('name'))
|
||||
|
||||
connectOutlet: ->
|
||||
view = @_super.apply(this, arguments)
|
||||
|
||||
if view
|
||||
_connectedOutletViews = Travis.app.get('_connectedOutletViews')
|
||||
unless _connectedOutletViews
|
||||
_connectedOutletViews = []
|
||||
|
||||
_connectedOutletViews.pushObject(view)
|
||||
Travis.app.set('_connectedOutletViews', _connectedOutletViews)
|
||||
|
||||
view
|
||||
|
||||
# TopController: Em.Controller.extend
|
||||
# userBinding: 'Travis.app.currentUser'
|
||||
|
||||
|
|
|
@ -2,7 +2,13 @@ minispade.require 'app'
|
|||
|
||||
@reset = ->
|
||||
Em.run ->
|
||||
Travis.app.destroy() if Travis.app
|
||||
if Travis.app
|
||||
if Travis.app.store
|
||||
Travis.app.store.destroy()
|
||||
if views = Travis.app.get('_connectedOutletViews')
|
||||
views.forEach (v) -> v.destroy()
|
||||
Travis.app.destroy()
|
||||
|
||||
waits(500) # TODO not sure what we need to wait for here
|
||||
$('#content').remove()
|
||||
$('body').append('<div id="content"></div>')
|
||||
|
|
Loading…
Reference in New Issue
Block a user