Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cms/static/coffee/spec/models/textbook_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe "CMS.Models.Textbook", ->
expect(@model.isEmpty()).toBeTruthy()

it "should have a URL set", ->
expect(_.result(@model, "url")).toBeTruthy()
expect(@model.url()).toBeTruthy()

it "should be able to reset itself", ->
@model.set("name", "foobar")
Expand Down Expand Up @@ -124,14 +124,14 @@ describe "CMS.Models.Textbook", ->

describe "CMS.Collections.TextbookSet", ->
beforeEach ->
CMS.URL.TEXTBOOK = "/textbooks"
CMS.URL.TEXTBOOKS = "/textbooks"
@collection = new CMS.Collections.TextbookSet()

afterEach ->
delete CMS.URL.TEXTBOOK
delete CMS.URL.TEXTBOOKS

it "should have a url set", ->
expect(_.result(@collection, "url"), "/textbooks")
expect(@collection.url()).toEqual("/textbooks")

it "can call save", ->
spyOn(@collection, "sync")
Expand Down
4 changes: 0 additions & 4 deletions cms/static/js/views/textbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ CMS.Views.ListTextbooks = Backbone.View.extend({
initialize: function() {
this.emptyTemplate = _.template($("#no-textbooks-tpl").text());
this.listenTo(this.collection, 'all', this.render);
this.listenTo(this.collection, 'destroy', this.handleDestroy);
},
tagName: "div",
className: "textbooks-list",
Expand Down Expand Up @@ -185,9 +184,6 @@ CMS.Views.ListTextbooks = Backbone.View.extend({
addOne: function(e) {
if(e && e.preventDefault) { e.preventDefault(); }
this.collection.add([{editing: true}]);
},
handleDestroy: function(model, collection, options) {
collection.remove(model);
}
});
CMS.Views.EditChapter = Backbone.View.extend({
Expand Down