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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
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.rbindex 00e89295d7e..cce4a2d1d16 100644--- a/app/contracts/user_preferences/params_contract.rb+++ b/app/contracts/user_preferences/params_contract.rb@@ -29,7 +29,7 @@module UserPreferencesclass ParamsContract < ::ParamsContractDATE_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].freezevalidate :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.rbindex 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 docontext 'when project setting with start_date, due_date and overdue set' dolet(: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 docontext 'when global setting with start_date, due_date and overdue set' dolet(: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 docontext 'when project setting with valid start_date, valid due_date and invalid overdue' dolet(: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 docontext 'when global setting with invalid start_date, valid due_date and valid overdue' dolet(:notification_settings) do[- { start_date: -1, due_date: 1, overdue: 1 }+ { start_date: -1, due_date: 1, overdue: 0 }]end