mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
describe('Tasks Controller', function() {
|
||||
var $rootScope, scope, user, ctrl;
|
||||
var $rootScope, shared, scope, user, ctrl;
|
||||
|
||||
beforeEach(function() {
|
||||
user = specHelper.newUser();
|
||||
@@ -10,10 +10,10 @@ describe('Tasks Controller', function() {
|
||||
$provide.value('Guide', {});
|
||||
});
|
||||
|
||||
inject(function($rootScope, $controller){
|
||||
inject(function($rootScope, $controller, Shared){
|
||||
|
||||
scope = $rootScope.$new();
|
||||
|
||||
shared = Shared;
|
||||
$controller('RootCtrl', {$scope: scope, User: {user: user}});
|
||||
|
||||
ctrl = $controller('TasksCtrl', {$scope: scope, User: {user: user}});
|
||||
@@ -28,4 +28,14 @@ describe('Tasks Controller', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('watch to updateStore', function() {
|
||||
it('updates itemStore when user gear changes', function() {
|
||||
sinon.stub(shared, 'updateStore').returns({item: true});
|
||||
user.items.gear.owned.foo = true;
|
||||
|
||||
scope.$digest();
|
||||
expect(scope.itemStore).to.eql({item: true});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user