Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
api/school corrected fixtures remove process
Browse files Browse the repository at this point in the history
better fixtures handling
  • Loading branch information
RusAlex committed Oct 28, 2016
1 parent 4eee7f8 commit 08a3bba
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
8 changes: 4 additions & 4 deletions test/integration/api/db/geotag.js
Expand Up @@ -45,13 +45,13 @@ describe('Geotag', () => {
}
});

after(() => {
after(async () => {
for (let post of posts) {
post.destroy();
await post.destroy();
}

for (let geotag of geotags) {
geotag.destroy();
await geotag.destroy();
}
});

Expand Down Expand Up @@ -103,4 +103,4 @@ describe('Geotag', () => {
expect(geotag.get('updated_at'), 'to equal', dates[1]);
});
});
});
});
8 changes: 4 additions & 4 deletions test/integration/api/db/hashtag.js
Expand Up @@ -45,13 +45,13 @@ describe('Hashtag', () => {
}
});

after(() => {
after(async () => {
for (let post of posts) {
post.destroy();
await post.destroy();
}

for (let hashtag of hashtags) {
hashtag.destroy();
await hashtag.destroy();
}
});

Expand Down Expand Up @@ -103,4 +103,4 @@ describe('Hashtag', () => {
expect(hashtag.get('updated_at'), 'to equal', dates[1]);
});
});
});
});
26 changes: 13 additions & 13 deletions test/integration/api/db/post.js
Expand Up @@ -39,9 +39,9 @@ describe('Post', () => {
school = await new School(SchoolFactory.build({updated_at: null})).save(null, {method: 'insert'});
});

after(() => {
post.destroy();
school.destroy();
after(async () => {
await post.destroy();
await school.destroy();
});

it('attachSchool updates school updated_at field', async () => {
Expand All @@ -66,9 +66,9 @@ describe('Post', () => {
}
});

after(() => {
after(async () => {
for (let geotag of geotags) {
geotag.destroy();
await geotag.destroy();
}
});

Expand Down Expand Up @@ -122,7 +122,7 @@ describe('Post', () => {
await newGeotag.refresh();
expect(newGeotag.get('post_count'), 'to equal', 1);

newGeotag.destroy();
await newGeotag.destroy();
});
});
});
Expand All @@ -140,9 +140,9 @@ describe('Post', () => {
}
});

after(() => {
after(async () => {
for (let school of schools) {
school.destroy();
await school.destroy();
}
});

Expand Down Expand Up @@ -196,7 +196,7 @@ describe('Post', () => {
await newSchool.refresh();
expect(newSchool.get('post_count'), 'to equal', 1);

newSchool.destroy();
await newSchool.destroy();
});
});
});
Expand All @@ -214,9 +214,9 @@ describe('Post', () => {
}
});

after(() => {
after(async () => {
for (let hashtag of hashtags) {
hashtag.destroy();
await hashtag.destroy();
}
});

Expand Down Expand Up @@ -270,8 +270,8 @@ describe('Post', () => {
await newHashtag.refresh();
expect(newHashtag.get('post_count'), 'to equal', 1);

newHashtag.destroy();
await newHashtag.destroy();
});
});
});
});
});
8 changes: 4 additions & 4 deletions test/integration/api/db/school.js
Expand Up @@ -45,13 +45,13 @@ describe('School', () => {
}
});

after(() => {
after(async () => {
for (let post of posts) {
post.destroy();
await post.destroy();
}

for (let school of schools) {
school.destroy();
await school.destroy();
}
});

Expand Down Expand Up @@ -103,4 +103,4 @@ describe('School', () => {
expect(school.get('updated_at'), 'to equal', dates[1]);
});
});
});
});
4 changes: 2 additions & 2 deletions test/integration/api/post.js
Expand Up @@ -180,8 +180,8 @@ describe('Post', () => {
});

after(async () => {
user.destroy();
post.destroy();
await user.destroy();
await post.destroy();
});

afterEach(async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/api/school.js
Expand Up @@ -36,9 +36,9 @@ describe('Post', () => {
}
});

after(() => {
after(async () => {
for (const school of schools) {
school.destroy();
await school.destroy();
}
});

Expand Down
2 changes: 1 addition & 1 deletion test/integration/auth.js
Expand Up @@ -385,7 +385,7 @@ describe('api v1', async () => {
});

after(async () => {
otherPost.destroy();
await otherPost.destroy();
});

describe('Posts', async () => {
Expand Down

0 comments on commit 08a3bba

Please sign in to comment.