Skip to content

Commit

Permalink
Use relative dates to fix time dependent spec
Browse files Browse the repository at this point in the history
The factories use relative dates but the spec use fixed dates, so we use
relative dates for all the set up.
  • Loading branch information
danidoni committed Dec 23, 2024
1 parent 6ca43c7 commit 8e653ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/spec/models/bs_request/embargo_date_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
end

context 'with multiple embargo attributes' do
let(:embargo_date) { Time.zone.parse('2024-12-24 18:30 CET') }
let(:embargo_date) { 1.week.from_now.change({ hour: 18, min: 30, sec: 0 }) }
let(:embargo_date_value) { build(:attrib_value, value: embargo_date.to_s) }
let(:other_source_project) { create(:embargo_date_attrib, project: create(:project), values: [embargo_date_value]).project }
let(:other_source_package) { create(:package, project: other_source_project) }
Expand Down

0 comments on commit 8e653ed

Please sign in to comment.