This repository was archived by the owner on Apr 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff 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} ) ;
You can’t perform that action at this time.
0 commit comments