Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit 49b7bce

Browse files
committed
Adding a test for the new feature
1 parent ae136e6 commit 49b7bce

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/api/release.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,32 @@ describe('api/release', () => {
106106
.send(releaseParams);
107107
expect(postResponse.body.success).to.equal(false);
108108
});
109+
110+
it('should still allow an admin user to create a game, even if they do not have privileges on that game', async function() {
111+
await dataMakers.makeGame('prod');
112+
let gameResponse = await request.get('http://localhost:3000/api/games');
113+
114+
// make a admin level access token
115+
let editor = await dataMakers.makeUser(2);
116+
let token = await dataMakers.getUserToken(editor);
117+
// get the game slug from the api response
118+
let gameSlug = gameResponse.body.data[0].slug;
119+
120+
// make a new commit id for the new release
121+
let commitId = dataMakers.makeRandomString(40);
122+
123+
// send the request
124+
let releaseParams = {
125+
status: 'dev',
126+
commitId: commitId,
127+
version: '1.0.0',
128+
token: token
129+
};
130+
131+
let postResponse = await request
132+
.post(`http://localhost:3000/api/release/${gameSlug}`)
133+
.send(releaseParams);
134+
expect(postResponse.body.success).to.equal(true);
135+
});
109136
});
110137
});

0 commit comments

Comments
 (0)