@@ -77,22 +77,22 @@ describe('Review Object Controller', function () {
7777 expect ( res . json . calledWith ( { name : short } ) ) . to . be . true
7878 } )
7979
80- it ( 'should return 404 if no pending review object exists for UUID' , async ( ) => {
80+ it ( 'should return 200 with pendingReview set to null if no pending review object exists for UUID' , async ( ) => {
8181 const uuid = '123e4567-e89b-12d3-a456-426614174000'
8282 req . params . identifier = uuid
8383 repoStub . getOrgReviewObjectByOrgUUID = sinon . stub ( ) . resolves ( null )
8484 await controller . getReviewObjectByOrgIdentifier ( req , res , next )
85- expect ( res . status . calledWith ( 404 ) ) . to . be . true
86- expect ( res . json . calledWith ( { message : 'No pending review object exists for this organization' } ) ) . to . be . true
85+ expect ( res . status . calledWith ( 200 ) ) . to . be . true
86+ expect ( res . json . calledWith ( { pendingReview : null } ) ) . to . be . true
8787 } )
8888
89- it ( 'should return 404 if no pending review object exists for short_name' , async ( ) => {
89+ it ( 'should return 200 with pendingReview set to null if no pending review object exists for short_name' , async ( ) => {
9090 const short = 'myorg'
9191 req . params . identifier = short
9292 repoStub . getOrgReviewObjectByOrgShortname = sinon . stub ( ) . resolves ( null )
9393 await controller . getReviewObjectByOrgIdentifier ( req , res , next )
94- expect ( res . status . calledWith ( 404 ) ) . to . be . true
95- expect ( res . json . calledWith ( { message : 'No pending review object exists for this organization' } ) ) . to . be . true
94+ expect ( res . status . calledWith ( 200 ) ) . to . be . true
95+ expect ( res . json . calledWith ( { pendingReview : null } ) ) . to . be . true
9696 } )
9797 } )
9898
0 commit comments