     expect(cfpLoadingBar.status()).toBe 1
     cfpLoadingBar.complete() # set as complete
     $timeout.flush()
+    $animate.triggerCallbacks()
+
 
     $http.get(endpoint, cache: cache).then (data) ->
       result = data

    cfpLoadingBar.start()
    $timeout.flush()
    $animate.triggerCallbacks()
    
    expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe true

    cfpLoadingBar.complete()
    $timeout.flush()
    $animate.triggerCallbacks()
    
    expect(isLoadingBarInjected($document.find(cfpLoadingBar.parentSelector))).toBe false


    $httpBackend.flush(1)
    expect(cfpLoadingBar.status()).toBe 1
    $timeout.flush()
    $animate.triggerCallbacks()


    $httpBackend.expectPOST(endpoint).respond response
