From 7b4b75b51a94aa523a0f284cd751191e3c031b69 Mon Sep 17 00:00:00 2001 From: Tim Alby Date: Fri, 5 Oct 2018 16:24:05 +0100 Subject: [PATCH 1/2] fix incorrect or missing test mocks --- .../coffee/Authentication/AuthenticationControllerTests.coffee | 2 ++ .../test/unit/coffee/Templates/TemplatesControllerTests.coffee | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/test/unit/coffee/Authentication/AuthenticationControllerTests.coffee b/services/web/test/unit/coffee/Authentication/AuthenticationControllerTests.coffee index 78f7b288f6..2f18743a1c 100644 --- a/services/web/test/unit/coffee/Authentication/AuthenticationControllerTests.coffee +++ b/services/web/test/unit/coffee/Authentication/AuthenticationControllerTests.coffee @@ -30,6 +30,8 @@ describe "AuthenticationController", -> revokeAllUserSessions: sinon.stub().callsArgWith(1, null) "../../infrastructure/Modules": @Modules = {hooks: {fire: sinon.stub().callsArgWith(2, null, [])}} "../SudoMode/SudoModeHandler": @SudoModeHandler = {activateSudoMode: sinon.stub().callsArgWith(1, null)} + "../Notifications/NotificationsBuilder": @NotificationsBuilder = + ipMatcherAffiliation: sinon.stub() @user = _id: ObjectId() email: @email = "USER@example.com" diff --git a/services/web/test/unit/coffee/Templates/TemplatesControllerTests.coffee b/services/web/test/unit/coffee/Templates/TemplatesControllerTests.coffee index a08789ede9..1e61b14c0b 100644 --- a/services/web/test/unit/coffee/Templates/TemplatesControllerTests.coffee +++ b/services/web/test/unit/coffee/Templates/TemplatesControllerTests.coffee @@ -59,7 +59,7 @@ describe 'TemplatesController', -> "uuid":v4:=>@uuid "request": @request "fs":@fs - "../../../../app/js/models/Project": {Project: @Project} + "../../../js/models/Project": {Project: @Project} @zipUrl = "%2Ftemplates%2F52fb86a81ae1e566597a25f6%2Fv%2F4%2Fzip&templateName=Moderncv%20Banking&compiler=pdflatex" @templateName = "project name here" @user_id = "1234" From c00a0a435daa57dfd43363e5b92003035249d8f7 Mon Sep 17 00:00:00 2001 From: Tim Alby Date: Fri, 5 Oct 2018 16:24:28 +0100 Subject: [PATCH 2/2] remove console.log in tests --- .../web/test/unit/coffee/Compile/CompileControllerTests.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/services/web/test/unit/coffee/Compile/CompileControllerTests.coffee b/services/web/test/unit/coffee/Compile/CompileControllerTests.coffee index 103a1f9eea..0d070d687e 100644 --- a/services/web/test/unit/coffee/Compile/CompileControllerTests.coffee +++ b/services/web/test/unit/coffee/Compile/CompileControllerTests.coffee @@ -194,7 +194,6 @@ describe "CompileController", -> .should.equal true it "should set the content-disposition header with a safe version of the project name", -> - console.log @res.setContentDisposition.args[0] @res.setContentDisposition .calledWith('', filename: "test_nam_.pdf") .should.equal true