From 575bdc62ec9566868f69b5d919832b5397b9a401 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 10 Sep 2015 14:32:18 +0100 Subject: [PATCH] Add a test for when the user can't be found. --- .../coffee/WebApiManager/WebApiManagerTests.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/track-changes/test/unit/coffee/WebApiManager/WebApiManagerTests.coffee b/services/track-changes/test/unit/coffee/WebApiManager/WebApiManagerTests.coffee index aec51ab2ca..177a7b26f0 100644 --- a/services/track-changes/test/unit/coffee/WebApiManager/WebApiManagerTests.coffee +++ b/services/track-changes/test/unit/coffee/WebApiManager/WebApiManagerTests.coffee @@ -72,6 +72,16 @@ describe "WebApiManager", -> .calledWith(new Error("web returned failure status code: 500")) .should.equal true + describe "when the user cannot be found", -> + beforeEach -> + @request.get = sinon.stub().callsArgWith(1, null, {statusCode: 404}, "nothing") + @WebApiManager.getUserInfo @user_id, @callback + + it "should return a null value", -> + @callback + .calledWith(null, null) + .should.equal true + describe "getProjectDetails", -> describe "successfully", ->