Created
September 6, 2013 18:12
-
-
Save jlsherrill/6467678 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Controller: SystemEventsController', function() { | |
var $scope, Nutupane, SystemTask, SystemTaskPoll, $httpBackend, mockedTasks; | |
beforeEach(module('Bastion.systems', 'Bastion.test-mocks')); | |
beforeEach(function() { | |
inject(function(_$httpBackend_) { | |
$httpBackend = _$httpBackend_; | |
}); | |
Nutupane = function() { | |
this.table = { | |
showColumns: function() {} | |
}; | |
this.get = function() {}; | |
}; | |
mockedTasks = []; | |
}); | |
afterEach(function() { | |
$httpBackend.verifyNoOutstandingExpectation(); | |
$httpBackend.verifyNoOutstandingRequest(); | |
}); | |
beforeEach(inject(function($controller, $rootScope) { | |
$scope = $rootScope.$new(); | |
$controller('SystemEventsController', {$scope: $scope, | |
System: System, | |
SystemTask: SystemTask, | |
SystemTaskPoll:SystemTaskPoll, | |
Nutupane: Nutupane}); | |
})); | |
it("Sets a table.", function() { | |
expect($scope.eventsTable).toBeTruthy(); | |
}); | |
it("provides a way to open the details panel.", function() { | |
$httpBackend.expectGET(Routes.apiSystemsPath() + "/tasks/").respond(mockedTasks); | |
spyOn($scope, "transitionTo"); | |
$scope.eventsTable.openEventInfo({ id: 2 }); | |
expect($scope.transitionTo).toHaveBeenCalledWith('systems.details.events.details', {eventId: 2}); | |
}); | |
}); | |
ERROR: | |
PhantomJS 1.9 (Linux) Controller: SystemEventsController Sets a table. FAILED | |
ReferenceError: Can't find variable: System | |
at /home/jlsherri/git/katello/engines/bastion/test/systems/details/system-events.controller.test.js:41 | |
at invoke (/home/jlsherri/git/katello/engines/bastion/vendor/assets/dev-components/angular/angular.js:2902) | |
at workFn (/home/jlsherri/git/katello/engines/bastion/vendor/assets/dev-components/angular-mocks/angular-mocks.js:1778) | |
Expected undefined to be truthy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment