Organize challenge controllers specs

This commit is contained in:
Blade Barringer
2015-07-24 11:33:34 -05:00
parent 61d0172567
commit 2722116b40

View File

@@ -33,6 +33,7 @@ describe('Challenges Controller', function() {
}); });
}); });
context('filtering', function() {
describe('filterChallenges', function() { describe('filterChallenges', function() {
var ownMem, ownNotMem, notOwnMem, notOwnNotMem; var ownMem, ownNotMem, notOwnMem, notOwnNotMem;
@@ -191,6 +192,9 @@ describe('Challenges Controller', function() {
describe('selectNone', function() { describe('selectNone', function() {
it('selects no groups'); it('selects no groups');
}); });
});
context('task manipulation', function() {
describe('shouldShow', function() { describe('shouldShow', function() {
it('overrides task controller function by always returning true', function() { it('overrides task controller function by always returning true', function() {
@@ -198,6 +202,34 @@ describe('Challenges Controller', function() {
}); });
}); });
describe('edit', function() {
it('transitions to edit page');
});
describe('addTask', function() {
it('adds default task to array');
it('removes text from new task input box');
});
describe('editTask', function() {
it('is Tasks.editTask', function() {
inject(function(Tasks) {
expect(scope.editTask).to.eql(Tasks.editTask);
});
});
});
describe('removeTask', function() {
it('asks user to confirm deletion');
it('removes task from list');
});
describe('saveTask', function() {
it('sets task._editing to false');
});
});
context('challenge owner interactions', function() {
describe("save challenge", function() { describe("save challenge", function() {
var alert; var alert;
@@ -412,44 +444,6 @@ describe('Challenges Controller', function() {
it('sets new challenge to null'); it('sets new challenge to null');
}); });
describe('edit', function() {
it('transitions to edit page');
});
describe('addTask', function() {
it('adds default task to array');
it('removes text from new task input box');
});
describe('editTask', function() {
it('is Tasks.editTask', function() {
inject(function(Tasks) {
expect(scope.editTask).to.eql(Tasks.editTask);
});
});
});
describe('removeTask', function() {
it('asks user to confirm deletion');
it('removes task from list');
});
describe('saveTask', function() {
it('sets task._editing to false');
});
describe('join', function() {
it('calls challenge join endpoint');
});
describe('clickLeave', function() {
it('opens a popover to confirm');
});
describe('leave', function() {
it('(@TODO: write tests)');
});
describe('clone', function() { describe('clone', function() {
var challengeToClone = { var challengeToClone = {
@@ -526,3 +520,18 @@ describe('Challenges Controller', function() {
}); });
}); });
}); });
describe('User interactions', function() {
describe('join', function() {
it('calls challenge join endpoint');
});
describe('clickLeave', function() {
it('opens a popover to confirm');
});
describe('leave', function() {
it('(@TODO: write tests)');
});
});
});