Fixing tests

stable
Alejandro Alonso 2015-04-30 09:07:16 +02:00 committed by Juanfran
parent 548d3d314b
commit bb3496f3d8
2 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,8 @@ class ProjectsService extends taiga.Service
if not @._inProgress if not @._inProgress
@._inProgress = true @._inProgress = true
@.projectsPromise = @rs.projects.listByMember(@rootScope.user?.id).then (projects) => @.projectsPromise = @rs.projects.listByMember(@rootScope.user?.id)
@.projectsPromise.then (projects) =>
for project in projects for project in projects
project.url = @projectUrl.get(project) project.url = @projectUrl.get(project)

View File

@ -10,8 +10,10 @@ describe "tgProjects", ->
} }
mocks.thenStub = sinon.stub() mocks.thenStub = sinon.stub()
mocks.finallyStub = sinon.stub()
mocks.resources.projects.listByMember.withArgs(10).returns({ mocks.resources.projects.listByMember.withArgs(10).returns({
then: mocks.thenStub then: mocks.thenStub
finally: mocks.finallyStub
}) })
provide.value "$tgResources", mocks.resources provide.value "$tgResources", mocks.resources
@ -86,6 +88,7 @@ describe "tgProjects", ->
expect(projectsService._inProgress).to.be.true expect(projectsService._inProgress).to.be.true
mocks.thenStub.callArg(0, projects) mocks.thenStub.callArg(0, projects)
mocks.finallyStub.callArg(0)
expect(projectsService._inProgress).to.be.false expect(projectsService._inProgress).to.be.false