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

Replace all option in parsing representer with 'real' setting

Oliver Günther2d6289d8a79e
diff --git a/app/models/notifications/scopes/mail_alert_unsent.rb b/app/models/notifications/scopes/mail_alert_unsent.rb
index 277d014b50e..51289e81d3c 100644
--- a/app/models/notifications/scopes/mail_alert_unsent.rb
+++ b/app/models/notifications/scopes/mail_alert_unsent.rb
@@ -35,7 +35,7 @@ module Notifications::Scopes
class_methods do
def mail_alert_unsent
- where(mail_alert_unsent: false)
+ where(mail_alert_sent: false)
end
end
end
diff --git a/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb b/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb
index 20450e8d44d..42b624c9840 100644
--- a/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb
+++ b/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb
@@ -72,7 +72,7 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jou
context 'with the user having registered for involved notifications' do
let(:recipient_notification_settings) do
[
- FactoryBot.build(:notification_setting, **notification_settings_all_false.merge(involved: true)),
+ FactoryBot.build(:notification_setting, **notification_settings_all_false.merge(involved: true))
]
end
@@ -82,7 +82,7 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jou
context 'with the user having registered for no notifications' do
let(:recipient_notification_settings) do
[
- FactoryBot.build(:notification_setting, **notification_settings_all_false),
+ FactoryBot.build(:notification_setting, **notification_settings_all_false)
]
end
diff --git a/spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rb b/spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rb
index 0ae8f7210df..62723c2164f 100644
--- a/spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rb
+++ b/spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rb
@@ -43,7 +43,7 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,
{
'notifications' => [
{
- 'all' => true,
+ 'involved' => true,
'_links' => {
'project' => {
'href' => '/api/v3/projects/1'
@@ -51,7 +51,7 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,
}
},
{
- 'all' => false,
+ 'involved' => false,
'mentioned' => true,
'_links' => {
'project' => {
@@ -69,10 +69,11 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,
in_project, global = subject.notification_settings
expect(in_project[:project_id]).to eq "1"
- expect(in_project[:all]).to be_truthy
+ expect(in_project[:involved]).to be_truthy
+ expect(in_project[:mentioned]).to be_nil
expect(global[:project_id]).to eq nil
- expect(global[:all]).to eq false
+ expect(global[:involved]).to eq false
expect(global[:mentioned]).to eq true
end
end
diff --git a/spec/models/notifications/scopes/reminder_mail_unsent.rb b/spec/models/notifications/scopes/reminder_mail_unsent_spec.rb
similarity index 100%
rename from spec/models/notifications/scopes/reminder_mail_unsent.rb
rename to spec/models/notifications/scopes/reminder_mail_unsent_spec.rb
diff --git a/spec/services/notifications/create_from_model_service_work_package_spec.rb b/spec/services/notifications/create_from_model_service_work_package_spec.rb
index 1aa3cf48fba..4361805b3d5 100644
--- a/spec/services/notifications/create_from_model_service_work_package_spec.rb
+++ b/spec/services/notifications/create_from_model_service_work_package_spec.rb
@@ -299,7 +299,7 @@ describe Notifications::CreateFromModelService,
let(:user_property) { :watcher }
let(:recipient_notification_settings) do
[
- FactoryBot.build(:notification_setting, **notification_settings_all_true),
+ FactoryBot.build(:notification_setting, **notification_settings_all_true)
]
end