Update RSpec syntax/usage
Fixes a deprecation warning
This commit is contained in:
parent
6e9b38f04b
commit
5a658ce580
@ -49,4 +49,18 @@ class CreateAccount < ApplicationService
|
||||
def create_lndhub_wallet(user)
|
||||
CreateLndhubWalletJob.perform_later(user)
|
||||
end
|
||||
|
||||
def exchange_xmpp_contacts_between_inviter_and_invitee
|
||||
ejabberd = EjabberdApiClient.new
|
||||
|
||||
EjabberdApiClient.add_roster_item({
|
||||
"localuser": @username,
|
||||
"localhost": @domain,
|
||||
"user": @inviter.cn,
|
||||
"host": @inviter.ou,
|
||||
"nick": @username,
|
||||
"group": "Friends",
|
||||
"subs": "both"
|
||||
})
|
||||
end
|
||||
end
|
||||
|
@ -4,7 +4,8 @@ RSpec.describe CreateLdapUserJob, type: :job do
|
||||
let(:ldap_client_mock) { instance_double(Net::LDAP) }
|
||||
|
||||
subject(:job) {
|
||||
described_class.any_instance.stub(:ldap_client).and_return(ldap_client_mock)
|
||||
allow_any_instance_of(described_class).to receive(:ldap_client).and_return(ldap_client_mock)
|
||||
|
||||
described_class.perform_later(
|
||||
'halfinney', 'kosmos.org', 'halfinney@example.com',
|
||||
'remember-remember-the-5th-of-november'
|
||||
@ -12,7 +13,11 @@ RSpec.describe CreateLdapUserJob, type: :job do
|
||||
}
|
||||
|
||||
it "creates a new document with the correct attributes" do
|
||||
ldap_client_mock.should_receive(:add).with(
|
||||
allow(ldap_client_mock).to receive(:add) # spy on mock
|
||||
|
||||
perform_enqueued_jobs { job }
|
||||
|
||||
expect(ldap_client_mock).to have_received(:add).with(
|
||||
dn: "cn=halfinney,ou=kosmos.org,cn=users,dc=kosmos,dc=org",
|
||||
attributes: {
|
||||
objectclass: ["top", "account", "person", "extensibleObject"],
|
||||
@ -23,8 +28,6 @@ RSpec.describe CreateLdapUserJob, type: :job do
|
||||
userPassword: "remember-remember-the-5th-of-november"
|
||||
}
|
||||
)
|
||||
|
||||
perform_enqueued_jobs { job }
|
||||
end
|
||||
|
||||
after do
|
||||
|
Loading…
x
Reference in New Issue
Block a user