     Backbone.sync.restore()
     @view.remove()
     @model.related.restore()
+    $.waypoints.restore()
+    $.fn.waypoint.restore()
 
   describe '#render', ->
     it 'renders the template', ->

  before (done) ->
    benv.setup =>
      benv.expose $: benv.require 'jquery'
      $.waypoint = sinon.stub()
      Backbone.$ = $
      @OverviewView = benv.requireWithJadeify resolve(__dirname, '../../client/views/overview'), ['template']
      done()

  after ->


  beforeEach ->
    $.onInfiniteScroll = sinon.stub()

    $.waypoints or= -> #
    $.fn.waypoint or= -> #
    sinon.stub $, 'waypoints'
    sinon.stub $.fn, 'waypoint'

    sinon.stub _, 'defer', (cb) -> cb()
    sinon.stub Backbone, 'sync'
