             expect(ctrl.scope.myProjects[1].slug).to.be.equal("test-proj-2")
 
         it "should have an empty project list when call showProjects and ther server have no projects", ->
-            projectListIsEmpty = true
+            getProjectsHasError = true
             ctrl.scope.showProjects()
             httpBackend.flush()
 
             expect(ctrl.scope.myProjects).to.be.lengthOf(0)
+
+

            httpBackend.verifyNoOutstandingRequest()

        it "should have the project list when call showProjects", ->
            projectListIsEmpty = false
            ctrl.scope.showProjects()
            httpBackend.flush()


            httpBackend = $httpBackend
            httpBackend.whenGET(APIURL+"/sites").respond(200, {test: "test"})
            httpBackend.whenGET(APIURL+"/projects").respond(() ->
                if getProjectsHasError
                    return [404, []]
                return [200, [{name: "test proj 1", slug: "test-proj-1"},
                              {name: "test proj 2", slug: "test-proj-2"}]]
            )
