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.
This commit is contained in:
parent
74ac275ece
commit
e5846e30f9
14 changed files with 352 additions and 278 deletions
30
app/queue/queue_test.js
Normal file
30
app/queue/queue_test.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
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);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue