From 78996a9c1f753b8a8c24c2ea2657064fd09705e2 Mon Sep 17 00:00:00 2001 From: polesye Date: Mon, 14 Apr 2014 19:14:47 +0300 Subject: [PATCH] Fix unit test. --- .../xmodule/js/spec/video/video_speed_control_spec.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js index e94c1fd84c..45db124f0a 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js @@ -220,15 +220,13 @@ beforeEach(function () { state = jasmine.initializePlayer(); state.videoSpeedControl.setSpeed(1.0); - spyOn($.fn, 'trigger').andCallThrough(); - - $('li[data-speed="0.75"] a').click(); }); it('trigger speedChange event', function () { - expect($.fn.trigger.mostRecentCall.args[0]).toEqual( - 'speedchange', ['0.75'] - ); + spyOnEvent(state.el, 'speedchange'); + + $('li[data-speed="0.75"] a').click(); + expect('speedchange').toHaveBeenTriggeredOn(state.el); expect(state.videoSpeedControl.currentSpeed).toEqual('0.75'); }); });