Files
habitica/test/client-old/spec/controllers/userCtrlSpec.js
2017-03-14 12:35:48 +11:00

38 lines
986 B
JavaScript

'use strict';
describe('User Controller', function() {
var $rootScope, shared, scope, user, User, ctrl, content;
beforeEach(function() {
user = specHelper.newUser();
User = {
user: user
};
module(function($provide) {
$provide.value('User', User);
$provide.value('Guide', {});
});
inject(function($rootScope, $controller, Shared, Content){
scope = $rootScope.$new();
Shared.wrap(user);
shared = Shared;
content = Content
$controller('RootCtrl', {$scope: scope, User: User, Shared: Shared});
ctrl = $controller('UserCtrl', {$scope: scope, User: User});
});
});
describe.only('getProgressDisplay', function() {
it('should return initial progress', function() {
sinon.stub(content, 'loginIncentives').onFirstCall().returns({
prevRewardKey: 0,
nextRewardKey: 1
});
var actual = scope.getProgressDisplay();
expect(actual).to.eql('');
});
});
});