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
linting
ulfertsa16dfcfad93e
diff --git a/app/services/notifications/create_from_model_service.rb b/app/services/notifications/create_from_model_service.rbindex 4a02890b3c9..ecd0b78aa0e 100644--- a/app/services/notifications/create_from_model_service.rb+++ b/app/services/notifications/create_from_model_service.rb@@ -87,7 +87,7 @@ class Notifications::CreateFromModelServiceresource:,journal:,actor: user_with_fallback,- reason: reason,+ reason:,read_ian: strategy.supports_ian? ? false : nil,mail_reminder_sent: strategy.supports_mail_digest? ? false : nil,mail_alert_sent: strategy.supports_mail? ? false : nil@@ -111,7 +111,7 @@ class Notifications::CreateFromModelServicedef delete_outdated_notifications(current_recipient_ids)Notification- .where(journal: journal)+ .where(journal:).where.not(recipient_id: current_recipient_ids).destroy_allenddiff --git a/spec/services/notifications/create_from_model_service_work_package_spec.rb b/spec/services/notifications/create_from_model_service_work_package_spec.rbindex 51255b9dd2c..8c35743e420 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@@ -137,7 +137,7 @@ describe Notifications::CreateFromModelService,endend- context 'assignee has all notifications disabled' do+ context 'when assignee has all notifications disabled' dolet(:recipient_notification_settings) do[build(:notification_setting, **notification_settings_all_false)@@ -147,7 +147,7 @@ describe Notifications::CreateFromModelService,it_behaves_like 'creates no notification'end- context 'assignee has all in app notifications enabled but only involved for mail' do+ context 'when assignee has all in app notifications enabled but only involved for mail' dolet(:recipient_notification_settings) do[build(:notification_setting, **notification_settings_all_false.merge(involved: true))@@ -166,13 +166,13 @@ describe Notifications::CreateFromModelService,endend- context 'assignee is not allowed to view work packages' do+ context 'when assignee is not allowed to view work packages' dolet(:permissions) { [] }it_behaves_like 'creates no notification'end- context 'assignee is placeholder user' do+ context 'when assignee is placeholder user' dolet(:recipient) { create :placeholder_user }it_behaves_like 'creates no notification'@@ -721,8 +721,8 @@ describe Notifications::CreateFromModelService,endshared_examples_for 'group mention' do- context 'group member is allowed to view the work package' do- context 'user wants to receive notifications' do+ context 'with a group member allowed to view the work package' do+ context 'when the user wants to receive notifications' doit_behaves_like 'creates notification' dolet(:notification_channel_reasons) do{@@ -735,7 +735,7 @@ describe Notifications::CreateFromModelService,endend- context 'user disabled mention notifications' do+ context 'when the user disabled mention notifications' dolet(:recipient_notification_settings) do[build(:notification_setting, **notification_settings_all_false.merge(mentioned: false))@@ -746,13 +746,13 @@ describe Notifications::CreateFromModelService,endend- context 'group is not allowed to view the work package' do+ context 'with the group not allowed to view the work package' dolet(:group_role) { create(:role, permissions: []) }let(:permissions) { [] }it_behaves_like 'creates no notification'- context 'but group member is allowed individually' do+ context 'with the group member allowed individually' dolet(:permissions) { [:view_work_packages] }it_behaves_like 'creates notification' do@@ -914,8 +914,8 @@ describe Notifications::CreateFromModelService,it 'removes the existing notification' docall- expect(Notification.exists?(id: existing_notification.id))- .to be_falsey+ expect(Notification)+ .not_to exist(id: existing_notification.id)endendend@@ -930,7 +930,7 @@ describe Notifications::CreateFromModelService,endend- context 'on a hash/id based mention' do+ context 'with a hash/id based mention' dolet(:note) do"Hello group##{group.id}"end@@ -938,7 +938,7 @@ describe Notifications::CreateFromModelService,it_behaves_like 'group mention'end- context 'on a tag based mention with the type after' do+ context 'with a tag based mention with the type after' dolet(:note) do<<~NOTEHello <mention class="mention" data-id="#{group.id}" data-type="group" data-text="@#{group.name}">@#{group.name}</mention>@@ -948,7 +948,7 @@ describe Notifications::CreateFromModelService,it_behaves_like 'group mention'end- context 'on a tag based mention with the type before' do+ context 'with a tag based mention with the type before' dolet(:note) do<<~NOTEHello <mention data-type="group" class="mention" data-id="#{group.id}" data-text="@#{group.name}">@#{group.name}</mention>@@ -1027,8 +1027,8 @@ describe Notifications::CreateFromModelService,it 'removes the existing notifications' docall- expect(Notification.exists?(id: existing_notification.id))- .to be_falsey+ expect(Notification)+ .not_to exist(id: existing_notification.id)endend