Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Stub a custom non working day that is < yesterday

Oliver Günthered7ecacb6d35
diff --git a/spec/contracts/queries/base_contract_spec.rb b/spec/contracts/queries/base_contract_spec.rb
index c5448500213..b2285a75c28 100644
--- a/spec/contracts/queries/base_contract_spec.rb
+++ b/spec/contracts/queries/base_contract_spec.rb
@@ -114,7 +114,7 @@ RSpec.describe Queries::BaseContract do
let(:timestamps) { "lastWorkingDay@00:00+00:00" }
before do
- allow(Day).to receive(:last_working) { Day.first }
+ allow(Day).to receive(:last_working) { Day.new(date: 7.days.ago) }
end
it_behaves_like 'contract is invalid', timestamps: :forbidden
diff --git a/spec/models/query_spec.rb b/spec/models/query_spec.rb
index ffc4684034b..1c4cd791b09 100644
--- a/spec/models/query_spec.rb
+++ b/spec/models/query_spec.rb
@@ -191,7 +191,7 @@ RSpec.describe Query,
let(:timestamps) { "lastWorkingDay@00:00+00:00" }
before do
- allow(Day).to receive(:last_working) { Day.first }
+ allow(Day).to receive(:last_working) { Day.new(date: 7.days.ago) }
end
it 'is invalid' do