File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
apps/meteor/tests/end-to-end/api Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -886,6 +886,25 @@ describe('[Users]', () => {
886886 } )
887887 . end ( done ) ;
888888 } ) ;
889+
890+ it ( 'should return an error when logged in user tries to register' , ( done ) => {
891+ void request
892+ . post ( api ( 'users.register' ) )
893+ . set ( credentials )
894+ . send ( {
895+ email : `newuser${ Date . now ( ) } @email.com` ,
896+ name : 'New User' ,
897+ username : `newuser${ Date . now ( ) } ` ,
898+ pass : 'P@ssw0rd1234.!' ,
899+ } )
900+ . expect ( 'Content-Type' , 'application/json' )
901+ . expect ( 400 )
902+ . expect ( ( res ) => {
903+ expect ( res . body ) . to . have . property ( 'success' , false ) ;
904+ expect ( res . body ) . to . have . property ( 'error' ) . and . to . be . equal ( 'Logged in users can not register again.' ) ;
905+ } )
906+ . end ( done ) ;
907+ } ) ;
889908 } ) ;
890909
891910 describe ( '[/users.info]' , ( ) => {
You can’t perform that action at this time.
0 commit comments