Simplify editTask

This commit is contained in:
Blade Barringer
2015-06-17 07:51:07 -05:00
parent e422ea065f
commit 4da3018ad9
4 changed files with 6 additions and 26 deletions

View File

@@ -176,17 +176,9 @@ describe('Challenges Controller', function() {
});
describe('editTask', function() {
it('calls Tasks.editTask', function() {
it('is 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);
expect(scope.editTask).to.eql(Tasks.editTask);
});
});
});

View File

@@ -22,17 +22,9 @@ describe('Tasks Controller', function() {
});
describe('editTask', function() {
it('calls Tasks.editTask', function() {
it('is 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);
expect(scope.editTask).to.eql(Tasks.editTask);
});
});
});

View File

@@ -49,9 +49,7 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
});
};
$scope.editTask = function(task) {
Tasks.editTask(task);
};
$scope.editTask = Tasks.editTask;
/**
* Create

View File

@@ -65,9 +65,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
list.focus = true;
};
$scope.editTask = function(task) {
Tasks.editTask(task);
};
$scope.editTask = Tasks.editTask;
/**
* Add the new task to the actions log