From 1f976a0e04a357abacef225044bfa911022759f8 Mon Sep 17 00:00:00 2001 From: Michael Mazour Date: Thu, 13 Sep 2018 09:59:14 +0100 Subject: [PATCH] Improve ExportsController unit tests Test the params the handler's called with. --- .../test/unit/coffee/Exports/ExportsControllerTests.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/web/test/unit/coffee/Exports/ExportsControllerTests.coffee b/services/web/test/unit/coffee/Exports/ExportsControllerTests.coffee index c14037d665..15d35707d9 100644 --- a/services/web/test/unit/coffee/Exports/ExportsControllerTests.coffee +++ b/services/web/test/unit/coffee/Exports/ExportsControllerTests.coffee @@ -34,7 +34,12 @@ describe 'ExportsController', -> it 'should ask the handler to perform the export', (done) -> @handler.exportProject = sinon.stub().yields(null, {iAmAnExport: true, v1_id: 897}) + expected = + project_id: project_id + user_id: user_id + brand_variation_id: brand_variation_id @controller.exportProject @req, send:(body) => + expect(@handler.exportProject.args[0][0]).to.deep.equal expected expect(body).to.deep.equal {export_v1_id: 897} done()