SmartIT_Extensions/BMC/smart-it-full/test/app/asset/relate-people-controller.sp...

37 lines
1.1 KiB
JavaScript

describe("RelatePeopleController", function () {
var modalInstance;
beforeEach(module('myitsmApp', 'assetModule', 'adminModule'));
beforeEach(inject(function ($rootScope, $controller, events) {
this.scope = $rootScope.$new();
this.events = events;
modalInstance = { // Create a mock object using spies
close: jasmine.createSpy('modalInstance.close'),
dismiss: jasmine.createSpy('modalInstance.dismiss'),
result: {
then: jasmine.createSpy('modalInstance.result.then')
}
};
this.createController = function () {
return $controller('RelatePeopleController', {
$scope: this.scope,
$modalInstance: modalInstance
});
};
this.controller = this.createController();
}));
it('should defined', function () {
expect(this.controller).toBeDefined();
});
it('should broadcast DISCARD_CHANGES and assign asste data', inject(function ($rootScope) {
$rootScope.$broadcast(this.events.MODAL_BACKDROP_CLICK);
}));
});