Skip to content

Commit

Permalink
fix flakey test - need to freeze time to use Time.current (otherwise …
Browse files Browse the repository at this point in the history
…1 second could elapse) (#7408)
  • Loading branch information
starswan authored Jan 14, 2025
1 parent dc08539 commit 0a32162
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
end

it "gets their access to a Jobseeker Profile logged" do
allow(Rails.logger).to receive(:info).with(anything)
expect(Rails.logger).to receive(:info)
.with("[Service Data] #{support_user.email} accessed Profile ID #{jobseeker_profile.id} at #{Time.current}")
freeze_time do
allow(Rails.logger).to receive(:info).with(anything)
expect(Rails.logger).to receive(:info)
.with("[Service Data] #{support_user.email} accessed Profile ID #{jobseeker_profile.id} at #{Time.current}")

get support_users_service_data_jobseeker_profile_path(jobseeker_profile)
get support_users_service_data_jobseeker_profile_path(jobseeker_profile)
end
end
end

Expand Down

0 comments on commit 0a32162

Please sign in to comment.