@@ -127,21 +127,30 @@ describe('Builds (e2e)', () => {
127127 } ) ;
128128
129129 describe ( 'PATCH /' , ( ) => {
130- it ( '200' , async ( ) => {
130+ it ( '200 jwt' , async ( ) => {
131+ const build = await buildsService . create ( { project : project . id , branchName : 'develop' } ) ;
132+
133+ return requestWithAuth ( app , 'patch' , `/builds/${ build . id } ` , { } , user . token )
134+ . expect ( 200 )
135+ . expect ( ( res ) => {
136+ expect ( res . body . isRunning ) . toBe ( false ) ;
137+ } ) ;
138+ } ) ;
139+
140+ it ( '200 api' , async ( ) => {
131141 const build = await buildsService . create ( { project : project . id , branchName : 'develop' } ) ;
132142
133143 return requestWithApiKey ( app , 'patch' , `/builds/${ build . id } ` , { } , user . apiKey )
134144 . expect ( 200 )
135145 . expect ( ( res ) => {
136- expect ( res . body . projectId ) . toBe ( project . id ) ;
137146 expect ( res . body . isRunning ) . toBe ( false ) ;
138147 } ) ;
139148 } ) ;
140149
141- it ( '401 ' , async ( ) => {
150+ it ( '403 ' , async ( ) => {
142151 const build = await buildsService . create ( { project : project . id , branchName : 'develop' } ) ;
143152
144- return requestWithAuth ( app , 'patch' , `/builds/${ build . id } ` , { } , '' ) . expect ( 401 ) ;
153+ return requestWithAuth ( app , 'patch' , `/builds/${ build . id } ` , { } , '' ) . expect ( 403 ) ;
145154 } ) ;
146155 } ) ;
147156} ) ;
0 commit comments