Jamstash/app/queue/queue_test.js
Hyzual e5846e30f9 Removes the player functions from the rootScope.
However, saving track's position is broken.
Some are still there because of problems I don't know how to solve, e.g. circular dependency between notifications and player.
Uses the queue controller for the sidebar queue.
Moves loadTrackPosition to the main controller.
2015-01-17 19:12:56 +01:00

30 lines
792 B
JavaScript

describe("Queue controller", function() {
'use strict';
var player, scope;
beforeEach(function() {
module('jamstash.queue.ctrl');
inject(function ($controller, $rootScope, _player_) {
scope = $rootScope.$new();
player = _player_;
// Mock the functions of the services
spyOn(player, "playSong").and.stub();
$controller('PlayerCtrl', {
$scope: scope,
player: player
});
});
it("When I call playSong, it calls playSong in the player service", function() {
var fakeSong = {"id": 3174};
scope.playSong(true, fakeSong);
expect(player.playSong).toHaveBeenCalledWith(true, fakeSong);
});
});
});