Move exchanging of XMPP contacts to account confirmation
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Since the ejabberd service is now being enabled after the confirmation,
we also need to move the exchanging of roster contacts to that point.
This commit is contained in:
Râu Cao
2023-03-20 17:59:43 +07:00
parent 90680368fb
commit 5b46f3adf5
4 changed files with 62 additions and 36 deletions

View File

@@ -65,34 +65,6 @@ RSpec.describe CreateAccount, type: :model do
end
end
describe "#exchange_xmpp_contacts" do
include ActiveJob::TestHelper
let(:inviter) { create :user, cn: "willherschel", ou: "kosmos.org" }
let(:invitation) { create :invitation, user: inviter }
let(:service) { CreateAccount.new(
username: 'isaacnewton',
email: 'isaacnewton@example.com',
password: 'bright-ideas-in-autumn',
invitation: invitation
)}
it "enqueues a job to exchange XMPP contacts between inviter and invitee" do
service.send(:exchange_xmpp_contacts)
expect(enqueued_jobs.size).to eq(1)
args = enqueued_jobs.first['arguments']
expect(args[0]['_aj_globalid']).to match('gid://akkounts/User')
expect(args[1]).to eq('isaacnewton')
expect(args[2]).to eq('kosmos.org')
end
after do
clear_enqueued_jobs
end
end
describe "#create_lndhub_account" do
include ActiveJob::TestHelper