Skip to content

Instantly share code, notes, and snippets.

@joeoravec
Created October 22, 2013 14:14
Show Gist options
  • Select an option

  • Save joeoravec/7101490 to your computer and use it in GitHub Desktop.

Select an option

Save joeoravec/7101490 to your computer and use it in GitHub Desktop.
describe('ProjectsEditCtrl tests', function () {
var $scope;
beforeEach(module('admin-projects'));
beforeEach(inject(function ($rootScope) {
$scope = $rootScope.$new();
}));
it('should remove an existing team member', inject(function ($controller) {
var teamMember = {};
$controller('ProjectsEditCtrl', {
$scope: $scope,
project: {
teamMembers: [teamMember]
}
});
//verify the initial setup
expect($scope.project.teamMembers).toEqual([teamMember]);
//execute and verify results
$scope.removeTeamMember(teamMember);
expect($scope.project.teamMembers).toEqual([]);
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment