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

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

            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", ->
            getProjectsHasError = true
            ctrl.scope.showProjects()
            httpBackend.flush()

            expect(ctrl.scope.myProjects).to.be.lengthOf(0)


