lint: Fix linting errors in api v2 tests

This commit is contained in:
Blade Barringer
2016-01-02 22:19:47 -06:00
parent ff1e5ef221
commit 116fffaf4f
23 changed files with 307 additions and 403 deletions

View File

@@ -15,7 +15,7 @@ describe('PUT /user', () => {
context('allowed operations', () => {
it('updates the user', async () => {
let updatedUser = await user.put('/user', {
'profile.name' : 'Frodo',
'profile.name': 'Frodo',
'preferences.costume': true,
'stats.hp': 14,
});
@@ -29,19 +29,19 @@ describe('PUT /user', () => {
context('top level protected operations', () => {
let protectedOperations = {
'gem balance': {balance: 100},
'auth': {'auth.blocked': true, 'auth.timestamps.created': new Date()},
'contributor': {'contributor.level': 9, 'contributor.admin': true, 'contributor.text': 'some text'},
'backer': {'backer.tier': 10, 'backer.npc': 'Bilbo'},
'subscriptions': {'purchased.plan.extraMonths': 500, 'purchased.plan.consecutive.trinkets': 1000},
auth: {'auth.blocked': true, 'auth.timestamps.created': new Date()},
contributor: {'contributor.level': 9, 'contributor.admin': true, 'contributor.text': 'some text'},
backer: {'backer.tier': 10, 'backer.npc': 'Bilbo'},
subscriptions: {'purchased.plan.extraMonths': 500, 'purchased.plan.consecutive.trinkets': 1000},
'customization gem purchases': {'purchased.background.tavern': true, 'purchased.skin.bear': true},
'tasks': {todos: [], habits: [], dailys: [], rewards: []},
tasks: {todos: [], habits: [], dailys: [], rewards: []},
};
each(protectedOperations, (data, testName) => {
it(`does not allow updating ${testName}`, async () => {
let errorText = [];
each(data, (value, operation) => {
errorText.push(t('messageUserOperationProtected', { operation: operation }));
errorText.push(t('messageUserOperationProtected', { operation }));
});
await expect(user.put('/user', data)).to.eventually.be.rejected.and.eql({
@@ -61,7 +61,7 @@ describe('PUT /user', () => {
it(`does not allow updating ${testName}`, async () => {
let errorText = [];
each(data, (value, operation) => {
errorText.push(t('messageUserOperationProtected', { operation: operation }));
errorText.push(t('messageUserOperationProtected', { operation }));
});
await expect(user.put('/user', data)).to.eventually.be.rejected.and.eql({