From c3b09d8cce1749a886e26c96faa862f2da7df2e3 Mon Sep 17 00:00:00 2001 From: Negue Date: Fri, 1 May 2015 13:55:33 +0200 Subject: [PATCH] test 2nd argument for openModal --- test/spec/groupCtrlSpec.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/spec/groupCtrlSpec.js b/test/spec/groupCtrlSpec.js index fd3d133925..21a43affb0 100644 --- a/test/spec/groupCtrlSpec.js +++ b/test/spec/groupCtrlSpec.js @@ -108,8 +108,11 @@ describe("Chat Controller", function() { scope.copyToDo(message); modalSpy.should.have.been.calledOnce; - // @TODO, should probably check the modal options that get passed in as well - modalSpy.should.have.been.calledWith('copyChatToDo'); + + modalSpy.should.have.been.calledWith('copyChatToDo', sinon.match(function(callArgToMatch){ + return callArgToMatch.controller == 'CopyMessageModalCtrl' + && callArgToMatch.scope.text == message.text + })); }); it('when copying a system message it opens modal with information from message', function() { @@ -126,8 +129,11 @@ describe("Chat Controller", function() { scope.copyToDo(message); modalSpy.should.have.been.calledOnce; - // @TODO, should probably check the modal options that get passed in as well - modalSpy.should.have.been.calledWith('copyChatToDo'); + + modalSpy.should.have.been.calledWith('copyChatToDo', sinon.match(function(callArgToMatch){ + return callArgToMatch.controller == 'CopyMessageModalCtrl' + && callArgToMatch.scope.text == message.text + })); }); }); });