From 7bb86b6cd263462d793da1aa0e9201acbe839988 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Mon, 17 Jun 2013 13:39:38 -0400 Subject: [PATCH] Fix showSpies and editSpies resetting in tests --- cms/static/coffee/spec/views/textbook_spec.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cms/static/coffee/spec/views/textbook_spec.coffee b/cms/static/coffee/spec/views/textbook_spec.coffee index 6b1c5835a6..d4b7782503 100644 --- a/cms/static/coffee/spec/views/textbook_spec.coffee +++ b/cms/static/coffee/spec/views/textbook_spec.coffee @@ -132,12 +132,12 @@ describe "CMS.Views.ListTextbooks", -> @collection = new CMS.Collections.TextbookSet @view = new CMS.Views.ListTextbooks({collection: @collection}) @view.render() - @showSpies.constructor.reset() - @editSpies.constructor.reset() it "should render the empty template if there are no textbooks", -> expect(@view.$el).toContainText("You haven't added any textbooks to this course yet") expect(@view.$el).toContain(".new-button") + expect(@showSpies.constructor).not.toHaveBeenCalled() + expect(@editSpies.constructor).not.toHaveBeenCalled() it "should render TextbookShow views by default if no textbook is being edited", -> # add three empty textbooks to the collection @@ -175,6 +175,10 @@ describe "CMS.Views.ListTextbooks", -> expect(@editSpies.constructor).toHaveBeenCalledWith({model: editing}) it "should add a new textbook when the new-button is clicked", -> + # reset spies + @showSpies.constructor.reset() + @editSpies.constructor.reset() + # test @view.$(".new-button").click() expect(@collection.length).toEqual(1)