describe 'Courseware', -> describe 'start', -> it 'create the navigation', -> spyOn(window, 'Navigation') Courseware.start() expect(window.Navigation).toHaveBeenCalled() it 'binds the Logger', -> spyOn(Logger, 'bind') Courseware.start() expect(Logger.bind).toHaveBeenCalled() describe 'render', -> beforeEach -> jasmine.stubRequests() @courseware = new Courseware spyOn(window, 'Histogram') spyOn(window, 'Problem') spyOn(window, 'Video') spyOn(XBlock, 'initializeBlocks') setFixtures """
""" @courseware.render() it 'ensure that the XModules have been loaded', -> expect(XBlock.initializeBlocks).toHaveBeenCalled() it 'detect the histrogram element and convert it', -> expect(window.Histogram).toHaveBeenCalledWith('3', [[0, 1]])