From 6fb4df1529524008c95dcf7036ebb29bcc8a0fb7 Mon Sep 17 00:00:00 2001 From: Jannik Pulfer Date: Tue, 2 Jul 2024 10:48:51 +0200 Subject: [PATCH] Fix specs to work with delayed job --- app/domain/ptime/update_people_data.rb | 4 ++-- spec/domain/ptime/update_people_data_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/domain/ptime/update_people_data.rb b/app/domain/ptime/update_people_data.rb index ceeeef9de..23dc8e34f 100644 --- a/app/domain/ptime/update_people_data.rb +++ b/app/domain/ptime/update_people_data.rb @@ -29,10 +29,10 @@ def run skills_person.nationality = 'CH' skills_person.save! - # Ptime::UpdatePeopleData.run + Ptime::UpdatePeopleData.run end end # rubocop:enable Metrics - # handle_asynchronously :run, :run_at => Proc.new { 15.minutes.from_now } + handle_asynchronously :run, :run_at => proc { 15.minutes.from_now } end end diff --git a/spec/domain/ptime/update_people_data_spec.rb b/spec/domain/ptime/update_people_data_spec.rb index 45d6fd365..2c45a05f5 100644 --- a/spec/domain/ptime/update_people_data_spec.rb +++ b/spec/domain/ptime/update_people_data_spec.rb @@ -105,7 +105,7 @@ to_return(body: employees.to_json, headers: { 'content-type': "application/vnd.api+json; charset=utf-8" }, status: 200) .with(basic_auth: [ptime_api_test_username, ptime_api_test_password]) - Ptime::UpdatePeopleData.new.run + Ptime::UpdatePeopleData.new.run_without_delay expect(person_longmax.reload.email).to eq("changedmax@example.com") expect(person_alice.reload.title).to eq("MSc in some other field") @@ -141,7 +141,7 @@ .with(basic_auth: [ptime_api_test_username, ptime_api_test_password]) Ptime::AssignEmployeeIds.new.run(should_map: true) - Ptime::UpdatePeopleData.new.run + Ptime::UpdatePeopleData.new.run_without_delay new_employee_attributes = new_employee[:data].first[:attributes] new_employee_name = "#{new_employee_attributes[:firstname]} #{new_employee_attributes[:lastname]}"