Use keyword arguments for ApplicationService calls
Not all services are using keywords, which breaks those calls in Ruby 3
This commit is contained in:
@@ -50,7 +50,7 @@ RSpec.describe 'E-Mail settings', type: :feature do
|
||||
|
||||
expect(LdapManager::UpdateEmailPassword).to receive(:call).and_return(true)
|
||||
expect(LdapManager::UpdateEmailMaildrop).to receive(:call)
|
||||
.with(user.dn, user.address).and_return(true)
|
||||
.with(dn: user.dn, address: user.address).and_return(true)
|
||||
|
||||
visit setting_path(:email)
|
||||
fill_in 'Current account password', with: "valid password"
|
||||
|
||||
@@ -29,7 +29,7 @@ RSpec.describe 'Profile settings', type: :feature do
|
||||
|
||||
scenario 'works with valid input' do
|
||||
expect(LdapManager::UpdateDisplayName).to receive(:call)
|
||||
.with(user.dn, "Marky Mark").and_return(true)
|
||||
.with(dn: user.dn, display_name: "Marky Mark").and_return(true)
|
||||
|
||||
visit setting_path(:profile)
|
||||
fill_in 'Display name', with: "Marky Mark"
|
||||
|
||||
@@ -53,7 +53,7 @@ RSpec.describe "Signup", type: :feature do
|
||||
expect(page).to have_content("Choose a password")
|
||||
|
||||
expect(CreateAccount).to receive(:call)
|
||||
.with({
|
||||
.with(account: {
|
||||
username: "tony", domain: "kosmos.org",
|
||||
email: "tony@example.com", password: "a-valid-password",
|
||||
invitation: Invitation.last
|
||||
@@ -97,7 +97,7 @@ RSpec.describe "Signup", type: :feature do
|
||||
expect(page).to have_content("Password is too short")
|
||||
|
||||
expect(CreateAccount).to receive(:call)
|
||||
.with({
|
||||
.with(account: {
|
||||
username: "tony", domain: "kosmos.org",
|
||||
email: "tony@example.com", password: "a-valid-password",
|
||||
invitation: Invitation.last
|
||||
|
||||
@@ -190,7 +190,7 @@ RSpec.describe User, type: :model do
|
||||
|
||||
it "updates the LDAP 'mail' attribute" do
|
||||
expect(LdapManager::UpdateEmail).to receive(:call)
|
||||
.with("cn=willherschel,ou=kosmos.org,cn=users,dc=kosmos,dc=org", "will@hrsch.el")
|
||||
.with(dn: "cn=willherschel,ou=kosmos.org,cn=users,dc=kosmos,dc=org", address: "will@hrsch.el")
|
||||
user.send :devise_after_confirmation
|
||||
end
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ require 'rails_helper'
|
||||
|
||||
RSpec.describe CreateAccount, type: :model do
|
||||
describe "#create_user_in_database" do
|
||||
let(:service) { CreateAccount.new(
|
||||
let(:service) { CreateAccount.new(account: {
|
||||
username: 'isaacnewton',
|
||||
email: 'isaacnewton@example.com',
|
||||
password: 'bright-ideas-in-autumn'
|
||||
)}
|
||||
})}
|
||||
|
||||
it "creates a new user record in the akkounts database" do
|
||||
expect(User.count).to eq(0)
|
||||
@@ -19,12 +19,12 @@ RSpec.describe CreateAccount, type: :model do
|
||||
|
||||
describe "#update_invitation" do
|
||||
let(:invitation) { create :invitation }
|
||||
let(:service) { CreateAccount.new(
|
||||
let(:service) { CreateAccount.new(account: {
|
||||
username: 'isaacnewton',
|
||||
email: 'isaacnewton@example.com',
|
||||
password: 'bright-ideas-in-autumn',
|
||||
invitation: invitation
|
||||
)}
|
||||
})}
|
||||
|
||||
before(:each) do
|
||||
service.send(:update_invitation, 23)
|
||||
@@ -42,11 +42,11 @@ RSpec.describe CreateAccount, type: :model do
|
||||
describe "#add_ldap_document" do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
let(:service) { CreateAccount.new(
|
||||
let(:service) { CreateAccount.new(account: {
|
||||
username: 'halfinney',
|
||||
email: 'halfinney@example.com',
|
||||
password: 'remember-remember-the-5th-of-november'
|
||||
)}
|
||||
})}
|
||||
|
||||
it "enqueues a job to create the LDAP user document" do
|
||||
service.send(:add_ldap_document)
|
||||
@@ -68,10 +68,10 @@ RSpec.describe CreateAccount, type: :model do
|
||||
describe "#create_lndhub_account" do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
let(:service) { CreateAccount.new(
|
||||
let(:service) { CreateAccount.new(account: {
|
||||
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 account" do
|
||||
|
||||
Reference in New Issue
Block a user