@@ -357,61 +357,6 @@ describe('GET Project', () => {
357357 } ) ;
358358 } ) ;
359359
360- it ( 'should return attachment with downloadUrl' , ( done ) => {
361- models . ProjectAttachment . create ( {
362- projectId : project1 . id ,
363- path : 'projects/1/spec.pdf' ,
364- type : ATTACHMENT_TYPES . FILE ,
365- tags : [ 'tag2' ] ,
366- contentType : 'application/pdf' ,
367- createdBy : 1 ,
368- updatedBy : 1 ,
369- name : 'spec.pdf' ,
370- description : 'blah' ,
371- } ) . then ( ( attachment ) => {
372- const mockHttpClient = {
373- defaults : { headers : { common : { } } } ,
374- post : ( ) => new Promise ( resolve => resolve ( {
375- status : 200 ,
376- data : {
377- result : {
378- status : 200 ,
379- content : {
380- path : 'projects/1/spec.pdf' ,
381- preSignedURL : 'https://www.topcoder-dev.com/downloadUrl' ,
382- } ,
383- } ,
384- } ,
385- } ) ) ,
386- } ;
387- const spy = sinon . spy ( mockHttpClient , 'post' ) ;
388- const stub = sinon . stub ( util , 'getHttpClient' , ( ) => mockHttpClient ) ;
389-
390- request ( server )
391- . get ( `/v5/projects/${ project1 . id } ` )
392- . set ( {
393- Authorization : `Bearer ${ testUtil . jwts . admin } ` ,
394- } )
395- . expect ( 'Content-Type' , / j s o n / )
396- . expect ( 200 )
397- . end ( ( err , res ) => {
398- stub . restore ( ) ;
399- if ( err ) {
400- done ( err ) ;
401- } else {
402- const resJson = res . body ;
403- should . exist ( resJson ) ;
404- spy . should . have . been . calledOnce ;
405- resJson . attachments . should . have . lengthOf ( 1 ) ;
406- resJson . attachments [ 0 ] . path . should . equal ( attachment . path ) ;
407- // downloadUrl no more needed
408- // resJson.attachments[0].downloadUrl.should.exist;
409- done ( ) ;
410- }
411- } ) ;
412- } ) ;
413- } ) ;
414-
415360 describe ( 'URL Query fields' , ( ) => {
416361 it ( 'should not return "email" for project members when "fields" query param is not defined (to non-admin users)' , ( done ) => {
417362 request ( server )
0 commit comments