generator-hyper-angular
Version:
Yeoman generator for AngularJS/Express/node.js apps emphasizing modularity, configuration, and testing
40 lines (30 loc) • 808 B
JavaScript
(function () {
/* jshint expr: true */
'use strict';
describe('byteCount controller', function () {
var $controller,
$rootScope,
scope,
ctrl;
beforeEach(module('<%= _.slugify(_.humanize(projectName)) %>.controllers.byteCount'));
beforeEach(inject(function (_$controller_, _$rootScope_) {
$controller = _$controller_;
$rootScope = _$rootScope_;
scope = $rootScope.$new();
ctrl = $controller('ByteCountCtrl', {
$scope: scope
});
}));
it('should exist', function () {
expect(ctrl).to.exist;
});
it('should be an object', function () {
expect(ctrl).to.be.an('object');
});
it('should set byteLength to the length of byteCount', function () {
scope.byteCount = 'abc';
scope.$digest();
expect(scope.byteLength).to.equal(3);
});
});
})();