Skip to content

Commit

Permalink
Fix specs to work with delayed job
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomTannenbaum committed Jul 2, 2024
1 parent dbe7132 commit 6fb4df1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/domain/ptime/update_people_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions spec/domain/ptime/update_people_data_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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("[email protected]")
expect(person_alice.reload.title).to eq("MSc in some other field")
Expand Down Expand Up @@ -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]}"
Expand Down

0 comments on commit 6fb4df1

Please sign in to comment.