 
   context 'the results widget', ->
 
-    before () ->
+    beforeEach () ->
       scope = nock('http://fooserver')
-        .persist()
         .get('/5/search')
         .query(true)
         .reply((uri, requestBody)->

      # reset the query input, to get rid of callbacks
      $('body').empty().append('<input type="text" id="query"></input>')
      @queryInput = $('#query')

    it 'triggers a search on third character', (done) ->
      queryInputWidget = new doofinder.widgets.QueryInput '#query'

    navigator.userAgent = 'Nasty Navigator' # kudos to @jesusenlanet: great Name!
    navigator.appVersion = '0.0.1'
    global.doofinder = require "../lib/doofinder.js"


  afterEach () ->
    delete global.document
