Commit b8fd728e by Prem Sichanugrist

Pass in element in CMS.start() instead

parent 28959973
......@@ -10,11 +10,12 @@ describe "CMS", ->
describe "start", ->
beforeEach ->
@element = $("<div>")
spyOn(CMS.Views, "Course").andReturn(jasmine.createSpyObj("Course", ["render"]))
CMS.start()
CMS.start(@element)
it "create the Course", ->
expect(CMS.Views.Course).toHaveBeenCalled()
expect(CMS.Views.Course).toHaveBeenCalledWith(el: @element)
expect(CMS.Views.Course().render).toHaveBeenCalled()
describe "view stack", ->
......
......@@ -4,8 +4,8 @@
viewStack: []
start: ->
new CMS.Views.Course(el: $('section.main-container')).render()
start: (el) ->
new CMS.Views.Course(el: el).render()
replaceView: (view) ->
@viewStack = [view]
......@@ -32,4 +32,4 @@ $ ->
$.ajaxSetup
headers : { 'X-CSRFToken': $.cookie 'csrftoken' }
CMS.start()
CMS.start($('section.main-container'))
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