42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
describe('Sidebar module', function () {
|
|
var $compile,
|
|
$rootScope,
|
|
$controller,
|
|
$httpBackend;
|
|
|
|
beforeEach(module('bansho.sidebar'));
|
|
|
|
beforeEach(inject(function (_$compile_, _$rootScope_, _$controller_, _$httpBackend_) {
|
|
$compile = _$compile_;
|
|
$rootScope = _$rootScope_;
|
|
$controller = _$controller_;
|
|
$httpBackend = _$httpBackend_;
|
|
|
|
$httpBackend.expectGET('components/sidebar/sidebar.html').respond('<li></li>');
|
|
}));
|
|
|
|
describe('SideBarCtrl', function () {
|
|
|
|
it('should be defined', function () {
|
|
var scope = $rootScope.$new(),
|
|
ctrl = $controller('SideBarCtrl', { $scope : scope });
|
|
|
|
expect(ctrl).toBeDefined();
|
|
});
|
|
|
|
});
|
|
|
|
describe('Sidebar directive', function () {
|
|
|
|
it('should send a GET request', function () {
|
|
var element = $compile('<bansho-sidebar></bansho-sidebar>')($rootScope);
|
|
$httpBackend.flush();
|
|
|
|
expect(element.html()).toBe('<li></li>');
|
|
});
|
|
|
|
});
|
|
});
|