Fix exception during signup
This commit is contained in:
parent
0f0f296a5e
commit
bc20e89617
@ -10,7 +10,7 @@ class CreateAccount < ApplicationService
|
|||||||
def call
|
def call
|
||||||
user = create_user_in_database
|
user = create_user_in_database
|
||||||
add_ldap_document
|
add_ldap_document
|
||||||
create_lndhub_wallet
|
create_lndhub_wallet(user)
|
||||||
|
|
||||||
if @invitation.present?
|
if @invitation.present?
|
||||||
update_invitation(user.id)
|
update_invitation(user.id)
|
||||||
@ -46,7 +46,7 @@ class CreateAccount < ApplicationService
|
|||||||
ExchangeXmppContactsJob.perform_later(@invitation.user, @username, @domain)
|
ExchangeXmppContactsJob.perform_later(@invitation.user, @username, @domain)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_lndhub_wallet
|
def create_lndhub_wallet(user)
|
||||||
CreateLndhubWalletJob.perform_later(user)
|
CreateLndhubWalletJob.perform_later(user)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -92,4 +92,27 @@ RSpec.describe CreateAccount, type: :model do
|
|||||||
clear_enqueued_jobs
|
clear_enqueued_jobs
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#create_lndhub_wallet" do
|
||||||
|
include ActiveJob::TestHelper
|
||||||
|
|
||||||
|
let(:service) { CreateAccount.new(
|
||||||
|
username: 'halfinney', email: 'halfinney@example.com',
|
||||||
|
password: 'bright-ideas-in-winter'
|
||||||
|
)}
|
||||||
|
let(:new_user) { create :user, cn: "halfinney", ou: "kosmos.org" }
|
||||||
|
|
||||||
|
it "enqueues a job to create an LndHub wallet" do
|
||||||
|
service.send(:create_lndhub_wallet, new_user)
|
||||||
|
|
||||||
|
expect(enqueued_jobs.size).to eq(1)
|
||||||
|
|
||||||
|
args = enqueued_jobs.first['arguments']
|
||||||
|
expect(args[0]['_aj_globalid']).to match('gid://akkounts/User')
|
||||||
|
end
|
||||||
|
|
||||||
|
after do
|
||||||
|
clear_enqueued_jobs
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user