diff --git a/cms/static/coffee/spec/models/textbook_spec.coffee b/cms/static/coffee/spec/models/textbook_spec.coffee index 1d2134c0a5..6212c46e02 100644 --- a/cms/static/coffee/spec/models/textbook_spec.coffee +++ b/cms/static/coffee/spec/models/textbook_spec.coffee @@ -53,6 +53,7 @@ describe "CMS.Models.Textbook input/output", -> clientModelSpec = { "name": "My Textbook", "showChapters": false, + "editing": false, "chapters": [{ "name": "Chapter 1", "asset_path": "/ch1.pdf", @@ -85,11 +86,6 @@ describe "CMS.Collections.TextbookSet", -> @collection.save() expect(@collection.sync).toHaveBeenCalledWith("update", @collection, undefined) - it "should respond to editOne events", -> - model = new CMS.Models.Textbook() - @collection.trigger('editOne', model) - expect(@collection.editing).toEqual(model) - describe "CMS.Models.Chapter", -> beforeEach -> diff --git a/cms/static/coffee/spec/views/textbook_spec.coffee b/cms/static/coffee/spec/views/textbook_spec.coffee index e6519471a2..4aa48795a3 100644 --- a/cms/static/coffee/spec/views/textbook_spec.coffee +++ b/cms/static/coffee/spec/views/textbook_spec.coffee @@ -29,11 +29,9 @@ describe "CMS.Views.ShowTextbook", -> @view.render() expect(@view.$el).toContainText("Life Sciences") - it "should trigger an editOne event on the collection when the edit button is clicked", -> - spyOn(@collection, "trigger").andCallThrough() + it "should set the 'editing' property on the model when the edit button is clicked", -> @view.render().$(".edit").click() - expect(@collection.trigger).toHaveBeenCalledWith("editOne", @model) - expect(@collection.editing).toEqual(@model) + expect(@model.get("editing")).toBeTruthy() it "should pop a delete confirmation when the delete button is clicked", -> promptSpies = spyOnConstructor(CMS.Views.Prompt, "Warning", ["show", "hide"]) @@ -77,11 +75,10 @@ describe "CMS.Views.EditTextbook", -> appendSetFixtures($("