diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js index 80299c6e7f..88da768f84 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_player_spec.js @@ -411,8 +411,6 @@ beforeEach(function () { initialize(); - videoPlayer.currentTime = 60; - spyOn(videoPlayer, 'updatePlayTime').andCallThrough(); spyOn(state, 'setSpeed').andCallThrough(); spyOn(videoPlayer, 'log').andCallThrough(); @@ -421,6 +419,8 @@ describe('always', function () { beforeEach(function () { + + videoPlayer.currentTime = 60; videoPlayer.onSpeedChange('0.75', false); }); @@ -446,8 +446,8 @@ describe('when the video is playing', function () { beforeEach(function () { + videoPlayer.currentTime = 60; videoPlayer.play(); - videoPlayer.onSpeedChange('0.75', false); }); @@ -459,8 +459,6 @@ describe('when the video is not playing', function () { beforeEach(function () { - videoPlayer.pause(); - videoPlayer.onSpeedChange('0.75', false); }); @@ -468,6 +466,15 @@ expect(videoPlayer.player.setPlaybackRate) .toHaveBeenCalledWith('0.75'); }); + + it('video has a correct speed', function () { + spyOn(videoPlayer, 'onSpeedChange'); + state.speed = '2.0'; + videoPlayer.onPlay(); + expect(videoPlayer.onSpeedChange).toHaveBeenCalledWith('2.0'); + videoPlayer.onPlay(); + expect(videoPlayer.onSpeedChange.calls.length).toEqual(1); + }); }); });