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

fix failing specs and do not allow 1 day for overdue

Dmitriice8a4e973b09
diff --git a/app/contracts/user_preferences/params_contract.rb b/app/contracts/user_preferences/params_contract.rb
index 00e89295d7e..cce4a2d1d16 100644
--- a/app/contracts/user_preferences/params_contract.rb
+++ b/app/contracts/user_preferences/params_contract.rb
@@ -29,7 +29,7 @@
module UserPreferences
class ParamsContract < ::ParamsContract
DATE_ALERT_DURATIONS = [nil, 0, 1, 3, 7].freeze
- DATE_ALERT_OVERDUE_DURATIONS = [nil, 1, 3, 7].freeze
+ DATE_ALERT_OVERDUE_DURATIONS = [nil, 0, 3, 7].freeze
validate :only_one_global_setting,
if: -> { notifications.present? }
diff --git a/spec/contracts/user_preferences/params_contract_spec.rb b/spec/contracts/user_preferences/params_contract_spec.rb
index a19e3d20584..71140486547 100644
--- a/spec/contracts/user_preferences/params_contract_spec.rb
+++ b/spec/contracts/user_preferences/params_contract_spec.rb
@@ -89,7 +89,7 @@ describe UserPreferences::ParamsContract do
context 'when project setting with start_date, due_date and overdue set' do
let(:notification_settings) do
[
- { project_id: 1234, start_date: 1, due_date: 1, overdue: 1 }
+ { project_id: 1234, start_date: 1, due_date: 1, overdue: 0 }
]
end
@@ -99,7 +99,7 @@ describe UserPreferences::ParamsContract do
context 'when global setting with start_date, due_date and overdue set' do
let(:notification_settings) do
[
- { start_date: 1, due_date: 1, overdue: 1 }
+ { start_date: 1, due_date: 1, overdue: 0 }
]
end
@@ -109,7 +109,7 @@ describe UserPreferences::ParamsContract do
context 'when project setting with valid start_date, valid due_date and invalid overdue' do
let(:notification_settings) do
[
- { project_id: 1234, start_date: 1, due_date: 1, overdue: 0 }
+ { project_id: 1234, start_date: 1, due_date: 1, overdue: 1 }
]
end
@@ -119,7 +119,7 @@ describe UserPreferences::ParamsContract do
context 'when global setting with invalid start_date, valid due_date and valid overdue' do
let(:notification_settings) do
[
- { start_date: -1, due_date: 1, overdue: 1 }
+ { start_date: -1, due_date: 1, overdue: 0 }
]
end