Skip to content

Instantly share code, notes, and snippets.

@sayak-sarkar
Created July 7, 2014 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayak-sarkar/ec513bd118bbe42918c5 to your computer and use it in GitHub Desktop.
Save sayak-sarkar/ec513bd118bbe42918c5 to your computer and use it in GitHub Desktop.
PublicationListCtrl Unit Test
describe('Unit: Testing Owner PublicationListCtrl', function() {
beforeEach(angular.mock.module('incidentapp_worker'));
var publicationListCtrl, scope, publicationList;
beforeEach(angular.mock.inject(function ($controller, $rootScope, $location) {
publicationList = {};
scope = $rootScope.$new();
publicationListCtrl = $controller('PublicationListCtrl', {
$scope: scope,
$location: $location,
publicationList: publicationList
})
}));
it('should have a PublicationListCtrl controller', function() {
expect(publicationListCtrl).not.to.equal(null);
});
it('should have publications and newestPublications defined', function() {
expect(scope.publications).not.to.equal(undefined);
expect(scope.newestPublications).not.to.equal(undefined);
});
it('should have a showPublication function defined', function() {
expect(scope.showPublication).not.to.equal(undefined);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment