@@ -476,14 +476,38 @@ ibr(Config0) ->
476476 send_get_iq_register (Config3 )),
477477 ? match (# iq {type = result }, send_iq_register (Config3 , <<" some_self_chosen_name" >>)),
478478
479+ RedirectUrl = <<" http://localhost" >>,
480+ NewRegisterOpts2 = gen_mod :set_opt (redirect_url , RedirectUrl , NewRegisterOpts ),
481+ update_module_opts (Server , mod_register , NewRegisterOpts2 ),
482+ Config4 = reconnect (Config3 ),
483+ % % check redirect_url works
484+ # iq {type = result , sub_els = [# register {sub_els = [SubEl ]}]} =
485+ send_get_iq_register (Config4 ),
486+ ? match (# oob_x {url = RedirectUrl }, xmpp :decode (SubEl )),
487+ # invite_token {token = Token4 } = create_account_invite (Server , {<<>>, Server }),
488+ ? match (# iq {type = result }, send_pars (Config4 , Token4 )),
489+ # iq {type = result , sub_els = [# register {sub_els = SubEls }]} =
490+ send_get_iq_register (Config4 ),
491+ % % check for absence of redirect_url
492+ ? match ([], lists :filter (fun (El ) ->
493+ Decoded = xmpp :decode (El ),
494+ case Decoded of
495+ # oob_x {url = RedirectUrl } -> true ;
496+ _ -> false
497+ end
498+ end ,
499+ SubEls )),
500+ ? match (# iq {type = result }, send_iq_register (Config4 , <<" yet_another_self_chosen_name" >>)),
501+
479502 ejabberd_auth :remove_user (AccountName , Server ),
503+ ejabberd_auth :remove_user (<<" yet_another_self_chosen_name" >>, Server ),
480504 ejabberd_auth :remove_user (<<" some_self_chosen_name" >>, Server ),
481505 ejabberd_auth :remove_user (<<" some_much_better_name" >>, Server ),
482506 update_module_opts (Server , mod_register , OldRegisterOpts ),
483507 mod_invites :remove_user (<<" inviter" >>, Server ),
484508 mod_invites :expire_tokens (<<>>, Server ),
485- ? match (3 , mod_invites :cleanup_expired ()),
486- disconnect (Config3 ).
509+ ? match (4 , mod_invites :cleanup_expired ()),
510+ disconnect (Config4 ).
487511
488512ibr_reserved (Config0 ) ->
489513 Server = ? config (server , Config0 ),
0 commit comments