             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
+            httpBackend.expectGET(APIURL+"/projects").respond(400, [])
             ctrl.scope.showProjects()
             httpBackend.flush()
 

            httpBackend.verifyNoOutstandingRequest()

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


        httpBackend = null
        scope = null
        ctrl = null

        beforeEach(inject(($rootScope, $controller, $httpBackend) ->
            scope = $rootScope.$new()
