Split out potion and armoire out of the itemStore object

Fixes #5743
This commit is contained in:
Blade Barringer
2015-08-12 18:53:49 -05:00
parent 60f92a8997
commit bcf7c9712e
4 changed files with 32 additions and 17 deletions

View File

@@ -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});
});
});
});