From 8e653ed4fc28c86df4f5694114ac72cf4fbf6e2d Mon Sep 17 00:00:00 2001 From: Dani Donisa Date: Mon, 23 Dec 2024 14:56:15 +0100 Subject: [PATCH] Use relative dates to fix time dependent spec The factories use relative dates but the spec use fixed dates, so we use relative dates for all the set up. --- src/api/spec/models/bs_request/embargo_date_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/spec/models/bs_request/embargo_date_spec.rb b/src/api/spec/models/bs_request/embargo_date_spec.rb index 6df398f8104..a43dbbaf34c 100644 --- a/src/api/spec/models/bs_request/embargo_date_spec.rb +++ b/src/api/spec/models/bs_request/embargo_date_spec.rb @@ -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) }