           expect(result.state()).to.equal('pending')
 
       context 'after the XHR resolves', ->
-        beforeEach ->
+        beforeEach (done)->
           @spy_end = sinon.spy()
           @instance.on 'dbcreate_end', @spy_end
-
           @result = @instance.init()
-          return
+          @respondJSON(@shops_json)
+          # Ensure that XHR callbacks (which resolve @result) have finished
+          # so that expectations have been fullfilled
+          @result.then -> done()
 
         it 'adds data to storage', ->
-          @respondJSON(@shops_json)
-
           expect(@instance._get(@instance._data_key))
             .to.not.equal(false)
 
         it 'adds data_timestamp to storage', ->
-          @respondJSON(@shops_json)
           expect(@instance._get(@instance._timestamp_key))
             .to.not.equal(false)
 
         it 'triggers a "dbcreate_end" event', ->
-          @respondJSON(@shops_json)
           expect(@spy_end).to.be.calledOnce
 
         it 'resolves the returned deferred', (done)->
-          @respondJSON(@shops_json)
           @result.then ->
             expect(true).to.be.true
             done()

          @instance.search(@query)
          @clock.tick(@instance.config.XHRTimeout)
          @respondJSON(@makers_json)

        it 'triggers "dbsearch_results" event and passes results from updated data as first arg', (done)->
          @instance.on 'dbsearch_results', (results, query, xhr = false)=>

          @instance.search(@query)
          @clock.tick(@instance.config.XHRTimeout)
          @respondJSON(@makers_json)
          done()

        it 'updates @_data', (done)->
          data = {koko:'lala'}
