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

lift the requirement to have every property in the setting

ulferts9e396d6a65c1
diff --git a/config/schemas/api/user_preferences.schema.json b/config/schemas/api/user_preferences.schema.json
index e6bee480a9b..704c8932f40 100644
--- a/config/schemas/api/user_preferences.schema.json
+++ b/config/schemas/api/user_preferences.schema.json
@@ -26,14 +26,6 @@
"$ref": "#/definitions/DailyReminders"
}
},
- "required": [
- "auto_hide_popups",
- "comments_sorting",
- "daily_reminders",
- "hide_mail",
- "time_zone",
- "warn_on_leaving_unsaved"
- ],
"title": "UserPreferences"
},
"DailyReminders": {
diff --git a/spec/services/user_preferences/update_service_integration_spec.rb b/spec/services/user_preferences/update_service_integration_spec.rb
index ddef7cb505a..e7a756620d5 100644
--- a/spec/services/user_preferences/update_service_integration_spec.rb
+++ b/spec/services/user_preferences/update_service_integration_spec.rb
@@ -30,10 +30,15 @@ require 'spec_helper'
describe UserPreferences::UpdateService, 'integration', type: :model do
shared_let(:current_user) do
- FactoryBot.create(:user)
+ FactoryBot.create(:user).tap do |u|
+ u.pref.save
+ end
+ end
+ shared_let(:preferences) do
+ FactoryBot.create(:user_preference, user: current_user)
end
- let(:instance) { described_class.new(user: current_user, model: current_user.pref) }
+ let(:instance) { described_class.new(user: current_user, model: preferences) }
let(:attributes) { {} }
let(:service_result) do
@@ -41,9 +46,9 @@ describe UserPreferences::UpdateService, 'integration', type: :model do
.call(attributes)
end
- let(:updated_pref) {
+ let(:updated_pref) do
service_result.result
- }
+ end
describe 'notification_settings' do
subject { updated_pref.notification_settings }