From 3aa3e24889857fabf85d577559b517571695a740 Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Mon, 22 Jun 2015 13:19:17 -0300 Subject: [PATCH] Stub called assertions achieved through Sinon.JS --- spec/javascripts/module/graphic_spec.js.coffee | 6 +++--- spec/javascripts/repository/branch_spec.js.coffee | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/javascripts/module/graphic_spec.js.coffee b/spec/javascripts/module/graphic_spec.js.coffee index 563d256..80d9db6 100644 --- a/spec/javascripts/module/graphic_spec.js.coffee +++ b/spec/javascripts/module/graphic_spec.js.coffee @@ -25,8 +25,8 @@ describe "Module.Graphic", -> it "should show the drawer and start to load a graphic", -> @graphic = new Module.Graphic(@container, @metric_name, @module_id) - assert.isTrue(@drawer.slideDown.calledOnce) - assert.isTrue(@graphic.load.calledOnce) + sinon.assert.calledOnce(@drawer.slideDown) + sinon.assert.calledOnce(@graphic.load) after -> @drawer.is = sinon.stub().withArgs(':hidden').returns(false) @@ -37,7 +37,7 @@ describe "Module.Graphic", -> it 'should hide the drawer', -> @graphic = new Module.Graphic(@container, @metric_name, @module_id) - assert.isTrue(@drawer.slideUp.calledOnce) + sinon.assert.calledOnce(@drawer.slideUp) describe 'load', -> before -> diff --git a/spec/javascripts/repository/branch_spec.js.coffee b/spec/javascripts/repository/branch_spec.js.coffee index 82ad5a0..e994db7 100644 --- a/spec/javascripts/repository/branch_spec.js.coffee +++ b/spec/javascripts/repository/branch_spec.js.coffee @@ -26,7 +26,7 @@ describe "Repository.Branch", -> it "should hide the branches combo box", -> @subject.toggle() - assert.isTrue(@combo_box.hide.calledOnce) + sinon.assert.calledOnce(@combo_box.hide) context "scm_type != SVN", -> beforeEach -> @@ -37,7 +37,7 @@ describe "Repository.Branch", -> it "should show the branches combo box", -> @subject.toggle() - assert.isTrue(@combo_box.show.calledOnce) + sinon.assert.calledOnce(@combo_box.show) describe "#cancel_request", -> context 'request is not null', -> @@ -48,7 +48,7 @@ describe "Repository.Branch", -> it 'should abort the request', -> @subject.cancel_request() - assert.isTrue(@request.abort.calledOnce) + sinon.assert.calledOnce(@request.abort) assert.isNull(@subject.request) describe "#fill_options", -> -- libgit2 0.21.2