       expect(@manager.documentStore.length).toBe 1
       callbackCalled = false
 
-      responseProcesor = (documentPayload) ->
+      responseProcesor = (nextDocumentDefinition) ->
+        interfaceType = Object.keys(nextDocumentDefinition)[0]
+        documentPayload = nextDocumentDefinition[interfaceType]
         expect(documentPayload).toBeDefined()
         expect(documentPayload).not.toBe false
         expect(documentPayload.label).toBe 'testlabel'

  describe 'requestNextDocumentPayload', ->
    it('is equal as the manager\'s currentDocument payload', ->
      expect(@manager.documentStore.length).toBe 1
      documentPayload = @manager.next()
      expect(@manager.currentDocument.payload).toBe documentPayload
    )


        successCallback = ajaxOpts.success
        successCallback(simulatedAjaxResponse)

      responseProcesor = (nextDocumentDefinition) ->
        interfaceType = Object.keys(nextDocumentDefinition)[0]
        documentPayload = nextDocumentDefinition[interfaceType]

        expect(documentPayload).toBeDefined()
        expect(documentPayload).not.toBe false
        expect(documentPayload.label).toBe 'mockedlabel'
