From 3f4c45468fcb68301aad66fbc74ef5970b99f5cf Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Tue, 29 Jan 2013 11:36:10 -0500 Subject: [PATCH] Fix courseware jasmine tests --- lms/static/coffee/spec/courseware_spec.coffee | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/lms/static/coffee/spec/courseware_spec.coffee b/lms/static/coffee/spec/courseware_spec.coffee index 3b40930b41..a51e64ec21 100644 --- a/lms/static/coffee/spec/courseware_spec.coffee +++ b/lms/static/coffee/spec/courseware_spec.coffee @@ -10,19 +10,6 @@ describe 'Courseware', -> Courseware.start() expect(Logger.bind).toHaveBeenCalled() - describe 'bind', -> - beforeEach -> - @courseware = new Courseware - setFixtures """ -
-
-
- """ - - it 'binds the content change event', -> - @courseware.bind() - expect($('.course-content .sequence')).toHandleWith 'contentChanged', @courseware.render - describe 'render', -> beforeEach -> jasmine.stubRequests() @@ -30,6 +17,7 @@ describe 'Courseware', -> spyOn(window, 'Histogram') spyOn(window, 'Problem') spyOn(window, 'Video') + spyOn(XModule, 'loadModules') setFixtures """
@@ -41,12 +29,8 @@ describe 'Courseware', -> """ @courseware.render() - it 'detect the video elements and convert them', -> - expect(window.Video).toHaveBeenCalledWith('1', '1.0:abc1234') - expect(window.Video).toHaveBeenCalledWith('2', '1.0:def5678') - - it 'detect the problem element and convert it', -> - expect(window.Problem).toHaveBeenCalledWith(3, 'problem_3', '/example/url/') + it 'ensure that the XModules have been loaded', -> + expect(XModule.loadModules).toHaveBeenCalled() it 'detect the histrogram element and convert it', -> expect(window.Histogram).toHaveBeenCalledWith('3', [[0, 1]])