@@ -37,6 +37,9 @@ describe('Testing Registry Org Controller', () => {
3737 isSecretariat : sinon . stub ( ) . resolves ( false ) ,
3838 getOrg : sinon . stub ( ) . resolves ( { UUID : 'org-uuid' , short_name : 'activity_6' } )
3939 }
40+ const userRepo = {
41+ isAdmin : sinon . stub ( ) . resolves ( false )
42+ }
4043 const conversationRepo = {
4144 getAllByTargetUUID : sinon . stub ( ) . resolves ( [ {
4245 UUID : 'conversation-uuid' ,
@@ -60,6 +63,7 @@ describe('Testing Registry Org Controller', () => {
6063 params : { identifier : 'activity_6' } ,
6164 repositories : {
6265 getBaseOrgRepository : ( ) => orgRepo ,
66+ getBaseUserRepository : ( ) => userRepo ,
6367 getConversationRepository : ( ) => conversationRepo
6468 }
6569 }
@@ -76,6 +80,7 @@ describe('Testing Registry Org Controller', () => {
7680 expect ( payload . conversation [ 0 ] ) . to . not . have . property ( 'target_uuid' )
7781 expect ( payload . conversation [ 0 ] ) . to . not . have . property ( '_id' )
7882 expect ( payload . conversation [ 0 ] ) . to . not . have . property ( '__v' )
83+ expect ( userRepo . isAdmin . calledOnceWith ( 'user@activity_6.com' , 'activity_6' , { } ) ) . to . equal ( true )
7984 } )
8085
8186 it ( 'Should reject non-Secretariat access to another organization' , async ( ) => {
0 commit comments