Use keyword arguments for ApplicationService calls

Not all services are using keywords, which breaks those calls in Ruby 3
This commit is contained in:
2024-02-02 15:50:25 +02:00
parent 420442c1c0
commit 179a82d2dd
21 changed files with 44 additions and 45 deletions

View File

@@ -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