Merge pull request #1030 from edx/christina/textbook-cleanup
Minor cleanup.
This commit is contained in:
@@ -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")
|
||||
@@ -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")
|
||||
|
||||
@@ -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",
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user