Commit f71e54cc by Prem Sichanugrist

Removed unused Week Model

parent 2a36fee4
......@@ -38,19 +38,15 @@ describe "CMS.Views.Week", ->
describe "edit", ->
beforeEach ->
@view = new CMS.Views.Week(el: $("#week"), height: 100).render()
new CMS.Views.Week(el: $("#week"), height: 100).render()
spyOn(CMS, "replaceView")
spyOn(CMS.Views, "WeekEdit")
.andReturn(@view = jasmine.createSpy("Views.WeekEdit"))
spyOn(CMS.Models, "Week")
.andReturn(@model = jasmine.createSpy("Models.Week"))
$(".week-edit").click()
it "replace the content with edit week view", ->
expect(CMS.replaceView).toHaveBeenCalledWith @view
expect(CMS.Views.WeekEdit).toHaveBeenCalledWith model: @model
expect(CMS.Models.Week).toHaveBeenCalledWith
id: "i4x://mitx.edu/course/week"
expect(CMS.Views.WeekEdit).toHaveBeenCalled()
describe "on content.show", ->
beforeEach ->
......
class CMS.Models.Week extends Backbone.Model
......@@ -16,7 +16,7 @@ class CMS.Views.Week extends Backbone.View
edit: (event) =>
event.preventDefault()
CMS.replaceView(new CMS.Views.WeekEdit(model: new CMS.Models.Week(id: @$el.data('id'))))
CMS.replaceView(new CMS.Views.WeekEdit())
setHeight: =>
@$el.height(@options.height)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment