Refactored editTask into TaskService

This commit is contained in:
Blade Barringer
2015-06-16 23:11:04 -05:00
parent 18fe4b6166
commit 3ab27f32d2
10 changed files with 176 additions and 13 deletions

View File

@@ -174,4 +174,20 @@ describe('Challenges Controller', function() {
expect(scope.filterChallenges(notOwnNotMem)).to.eql(true);
});
});
describe('editTask', function() {
it('calls Tasks.editTask', function() {
inject(function(Tasks) {
sinon.stub(Tasks, 'editTask');
var task = {
id: 'task-id',
type: 'todo'
};
scope.editTask(task);
expect(Tasks.editTask).to.be.calledOnce;
expect(Tasks.editTask).to.be.calledWith(task);
});
});
});
});