소스 검색

Improve ExportsController unit tests

Test the params the handler's called with.
Michael Mazour 8 년 전
부모
커밋
1f976a0e04
1개의 변경된 파일과 5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      services/web/test/unit/coffee/Exports/ExportsControllerTests.coffee

+ 5 - 0
services/web/test/unit/coffee/Exports/ExportsControllerTests.coffee

@@ -34,7 +34,12 @@ describe 'ExportsController', ->
 
 
 	it 'should ask the handler to perform the export', (done) ->
 	it 'should ask the handler to perform the export', (done) ->
 		@handler.exportProject = sinon.stub().yields(null, {iAmAnExport: true, v1_id: 897})
 		@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) =>
 		@controller.exportProject @req, send:(body) =>
+			expect(@handler.exportProject.args[0][0]).to.deep.equal expected
 			expect(body).to.deep.equal {export_v1_id: 897}
 			expect(body).to.deep.equal {export_v1_id: 897}
 			done()
 			done()