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
Rename read_mail_digest into sent_mail and merge with non-wp items
Oliver Günther5b8df97498f8
diff --git a/app/contracts/notifications/create_contract.rb b/app/contracts/notifications/create_contract.rbindex 154cb51b741..3d57260fd00 100644--- a/app/contracts/notifications/create_contract.rb+++ b/app/contracts/notifications/create_contract.rb@@ -37,7 +37,7 @@ module Notificationsattribute :journalattribute :resource_typeattribute :read_ian- attribute :read_mail_digest+ attribute :sent_mailvalidate :validate_recipient_presentvalidate :validate_reason_presentdiff --git a/app/models/notification.rb b/app/models/notification.rbindex 16b2cd11429..2502d3a83ad 100644--- a/app/models/notification.rb+++ b/app/models/notification.rb@@ -22,6 +22,6 @@ class Notification < ApplicationRecordinclude Scopes::Scopedscopes :unsent_reminders_before,- :unread_mail_digest,+ :unsent_mail,:recipientenddiff --git a/app/models/notifications/scopes/unread_mail_digest.rb b/app/models/notifications/scopes/unread_mail_digest.rbindex a439b9091e1..6f61be2f085 100644--- a/app/models/notifications/scopes/unread_mail_digest.rb+++ b/app/models/notifications/scopes/unread_mail_digest.rb@@ -34,8 +34,8 @@ module Notifications::Scopesextend ActiveSupport::Concernclass_methods do- def unread_mail_digest- where(read_mail_digest: false)+ def unsent_mail+ where(sent_mail: false)endendenddiff --git a/app/models/notifications/scopes/unsent_reminders_before.rb b/app/models/notifications/scopes/unsent_reminders_before.rbindex 3456752ee70..1355f9d79f1 100644--- a/app/models/notifications/scopes/unsent_reminders_before.rb+++ b/app/models/notifications/scopes/unsent_reminders_before.rb@@ -39,7 +39,7 @@ module Notifications::Scopeswhere(Notification.arel_table[:created_at].lteq(time)).where(recipient: recipient).where("read_ian IS NULL OR read_ian IS FALSE")- .where(read_mail_digest: false)+ .where(sent_mail: false)endendenddiff --git a/app/services/notifications/create_from_model_service.rb b/app/services/notifications/create_from_model_service.rbindex fbd2cbb9d66..dc88413ab81 100644--- a/app/services/notifications/create_from_model_service.rb+++ b/app/services/notifications/create_from_model_service.rb@@ -78,7 +78,7 @@ class Notifications::CreateFromModelService{reason: strategy.supports_ian? && channel_reasons['in_app']&.first,read_ian: strategy.supports_ian? && channel_reasons.keys.include?('in_app') ? false : nil,- read_mail_digest: strategy.supports_mail_digest? && channel_reasons.keys.include?('mail_digest') ? false : nil+ sent_mail: strategy.supports_mail_digest? && channel_reasons.keys.include?('mail_digest') ? false : nil}enddiff --git a/app/services/notifications/mail_service.rb b/app/services/notifications/mail_service.rbindex 4255742cac5..095cfa11b06 100644--- a/app/services/notifications/mail_service.rb+++ b/app/services/notifications/mail_service.rb@@ -26,45 +26,51 @@# See COPYRIGHT and LICENSE files for more details.#++-class Notifications::MailService- def initialize(notification)- self.notification = notification- end+module Notifications+ class MailService+ include WithMarkedNotifications- def call- return unless supported?- return if ian_read?+ def initialize(notification)+ self.notification = notification+ end- strategy.send_mail(notification)- end+ def call+ return unless supported?+ return if ian_read?- private+ with_marked_notifications(notification.id) do+ strategy.send_mail(notification)+ end+ end- attr_accessor :notification+ private- def ian_read?- notification.read_ian- end+ attr_accessor :notification- def strategy- @strategy ||= if self.class.const_defined?("#{strategy_model}Strategy")- "#{self.class}::#{strategy_model}Strategy".constantize- end- end+ def ian_read?+ notification.read_ian+ end- def strategy_model- journal&.journable_type || resource&.class- end+ def strategy+ @strategy ||= if self.class.const_defined?("#{strategy_model}Strategy")+ "#{self.class}::#{strategy_model}Strategy".constantize+ end+ end- def journal- notification.journal- end+ def strategy_model+ journal&.journable_type || resource&.class+ end- def resource- notification.resource- end+ def journal+ notification.journal+ end++ def resource+ notification.resource+ end- def supported?- strategy.present?+ def supported?+ strategy.present?+ endendenddiff --git a/app/workers/mails/reminder_job.rb b/app/workers/mails/reminder_job.rbindex fce4238e780..f9abbd2efd5 100644--- a/app/workers/mails/reminder_job.rb+++ b/app/workers/mails/reminder_job.rb@@ -29,6 +29,8 @@#++class Mails::ReminderJob < Mails::DeliverJob+ include ::Notifications::WithMarkedNotifications+privatedef render_mail@@ -46,8 +48,8 @@ class Mails::ReminderJob < Mails::DeliverJob# Running the digest job will take some time to complete.# Within this timeframe, new notifications might come in. Upon notification creation- # a job is scheduled unless there is no prior digest notification that is not yet read (read_mail_digest: true).- # If we were to only set the read_mail_digest state at the end of the mail rendering an edge case of the following+ # a job is scheduled unless there is no prior digest notification that is not yet read (sent_mail: true).+ # If we were to only set the sent_mail state at the end of the mail rendering an edge case of the following# would lead to digest not being sent or at least sent unduly late:# * Job starts and fetches the notifications for rendering. We need to fetch all notifications to be rendered to# order them as desired.@@ -58,18 +60,4 @@ class Mails::ReminderJob < Mails::DeliverJob## A new job would then only be scheduled upon the creation of a new digest notification which (as unlikely as that is)# might only happen after some days have gone by.- #- # Because we mark the notifications as read even though they in fact aren't, we do it in a transaction- # so that the change is rolled back in case of an error.- def with_marked_notifications(notification_ids)- Notification.transaction do- mark_notifications_read(notification_ids)-- yield- end- end-- def mark_notifications_read(notification_ids)- Notification.where(id: notification_ids).update_all(read_mail_digest: true, updated_at: Time.current)- endenddiff --git a/app/workers/notifications/with_marked_notifications.rb b/app/workers/notifications/with_marked_notifications.rbnew file mode 100644index 00000000000..4fdf34f046a--- /dev/null+++ b/app/workers/notifications/with_marked_notifications.rb@@ -0,0 +1,53 @@+#-- encoding: UTF-8++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2021 the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+#++++# Because we mark the notifications as read even though they in fact aren't, we do it in a transaction+# so that the change is rolled back in case of an error.+module Notifications+ module WithMarkedNotifications+ extend ActiveSupport::Concern++ included do+ private++ def with_marked_notifications(notification_ids)+ Notification.transaction do+ mark_notifications_sent(notification_ids)++ yield+ end+ end++ def mark_notifications_sent(notification_ids)+ Notification.where(id: Array(notification_ids)).update_all(sent_mail: true, updated_at: Time.current)+ end+ end+ end+enddiff --git a/app/workers/notifications/workflow_job.rb b/app/workers/notifications/workflow_job.rbindex 78db85ac638..e5f9aa08ba7 100644--- a/app/workers/notifications/workflow_job.rb+++ b/app/workers/notifications/workflow_job.rb@@ -63,22 +63,15 @@ class Notifications::WorkflowJob < ApplicationJobwait: -> { Setting.journal_aggregation_time_minutes.to_i.minutes } do |*notification_ids|next unless notification_ids- Notification- .where(id: notification_ids)- .where(reason: NotificationSetting.mail_reasons)- .each do |notification|- Notifications::MailService- .new(notification)- .call- end-Notification.where(id: notification_ids)- .unread_mail # TODO+ .unsent_mail+ .where(reason: NotificationSetting.mail_reasons).each do |notification|Notifications::MailService.new(notification).callend+ endendenddiff --git a/config/locales/en.yml b/config/locales/en.ymlindex c6d4051d537..62411929788 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -686,7 +686,7 @@ en:attributes:read_ian:read_on_creation: 'cannot be set to true on notification creation.'- read_mail_digest:+ sent_mail:read_on_creation: 'cannot be set to true on notification creation.'reason:no_notification_reason: 'cannot be blank as IAN is chosen as a channel.'diff --git a/db/migrate/20210914065555_cleanup_notifications.rb b/db/migrate/20210914065555_cleanup_notifications.rbindex 7ae9a480cf0..80385d60239 100644--- a/db/migrate/20210914065555_cleanup_notifications.rb+++ b/db/migrate/20210914065555_cleanup_notifications.rb@@ -3,6 +3,7 @@ class CleanupNotifications < ActiveRecord::Migration[6.1]change_table :notifications, bulk: true do |t|t.remove :read_mail, :reason_mail, :reason_mail_digestt.rename :reason_ian, :reason+ t.rename :read_mail_digest, :sent_mailendchange_table :notification_settings, bulk: true do |t|@@ -31,6 +32,7 @@ class CleanupNotifications < ActiveRecord::Migration[6.1]t.boolean :read_mail, default: false, index: truet.integer :reason_mail, limit: 1t.integer :reason_mail_digest, limit: 1+ t.rename :sent_mail, :read_mail_digestt.rename :reason, :reason_ianenddiff --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.rbindex 8afa054dc8e..f635c668690 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@@ -63,7 +63,7 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jou{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -114,7 +114,7 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jou{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endenddiff --git a/spec/contracts/notifications/create_contract_spec.rb b/spec/contracts/notifications/create_contract_spec.rbindex 3cb5db3292b..20aa4f6d69a 100644--- a/spec/contracts/notifications/create_contract_spec.rb+++ b/spec/contracts/notifications/create_contract_spec.rb@@ -43,7 +43,7 @@ describe Notifications::CreateContract dolet(:notification_subject) { 'Some text' }let(:notification_reason) { :mentioned }let(:notification_read_ian) { false }- let(:notification_read_mail_digest) { false }+ let(:notification_sent_mail) { false }let(:notification) doNotification.new(project: notification_context,@@ -52,7 +52,7 @@ describe Notifications::CreateContract doreason: notification_reason,resource: notification_resource,read_ian: notification_read_ian,- read_mail_digest: notification_read_mail_digest)+ sent_mail: notification_sent_mail)endlet(:contract) { described_class.new(notification, current_user) }@@ -98,10 +98,10 @@ describe Notifications::CreateContract doit_behaves_like 'contract is invalid', read_ian: :read_on_creationend- context 'with read_mail_digest true' do- let(:notification_read_mail_digest) { true }+ context 'with sent_mail true' do+ let(:notification_sent_mail) { true }- it_behaves_like 'contract is invalid', read_mail_digest: :read_on_creation+ it_behaves_like 'contract is invalid', sent_mail: :read_on_creationendendenddiff --git a/spec/factories/notification_factory.rb b/spec/factories/notification_factory.rbindex 4f3a70ca2c2..6867fe2624d 100644--- a/spec/factories/notification_factory.rb+++ b/spec/factories/notification_factory.rb@@ -2,7 +2,7 @@ FactoryBot.define dofactory :notification dosubject { "MyText" } # rubocop:disable RSpec/EmptyLineAfterSubjectread_ian { false }- read_mail_digest { false }+ sent_mail { false }reason { :mentioned }recipient factory: :userproject { association :project }diff --git a/spec/models/notifications/scopes/unread_mail_digest_spec.rb b/spec/models/notifications/scopes/unread_mail_digest_spec.rbindex b706e8761a9..851f06fa60e 100644--- a/spec/models/notifications/scopes/unread_mail_digest_spec.rb+++ b/spec/models/notifications/scopes/unread_mail_digest_spec.rb@@ -30,11 +30,11 @@ require 'spec_helper'describe Notifications::Scopes::UnreadMailDigest, type: :model dodescribe '.unread_digest_mail' do- subject(:scope) { ::Notification.unread_mail_digest }+ subject(:scope) { ::Notification.unsent_mail }- let(:no_mail_notification) { FactoryBot.create(:notification, read_mail_digest: nil) }- let(:unread_mail_notification) { FactoryBot.create(:notification, read_mail_digest: false) }- let(:read_mail_notification) { FactoryBot.create(:notification, read_mail_digest: true) }+ let(:no_mail_notification) { FactoryBot.create(:notification, sent_mail: nil) }+ let(:unread_mail_notification) { FactoryBot.create(:notification, sent_mail: false) }+ let(:read_mail_notification) { FactoryBot.create(:notification, sent_mail: true) }before dono_mail_notificationdiff --git a/spec/models/notifications/scopes/unsent_reminders_before_spec.rb b/spec/models/notifications/scopes/unsent_reminders_before_spec.rbindex 10ca824c94f..410998bcf3b 100644--- a/spec/models/notifications/scopes/unsent_reminders_before_spec.rb+++ b/spec/models/notifications/scopes/unsent_reminders_before_spec.rb@@ -42,11 +42,10 @@ describe Notifications::Scopes::UnsentRemindersBefore, type: :model dolet(:notification) doFactoryBot.create(:notification,recipient: notification_recipient,- read_ian: notification_read_ian,- read_mail_digest: notification_read_mail_digest,+ sent_mail: notification_sent_mail,created_at: notification_created_at)end- let(:notification_read_mail_digest) { false }+ let(:notification_sent_mail) { false }let(:notification_read_ian) { false }let(:notification_created_at) { Time.current - 10.minutes }let(:notification_recipient) { recipient }@@ -80,13 +79,13 @@ describe Notifications::Scopes::UnsentRemindersBefore, type: :model doendcontext 'with a unread and not reminded notification created before the time and for the user' do- let(:notification_read_mail_digest) { nil }+ let(:notification_sent_mail) { nil }it_behaves_like 'is empty'endcontext 'with a unread but reminded notification created before the time and for the user' do- let(:notification_read_mail_digest) { true }+ let(:notification_sent_mail) { true }it_behaves_like 'is empty'enddiff --git a/spec/services/notifications/create_from_journal_job_shared.rb b/spec/services/notifications/create_from_journal_job_shared.rbindex d4fca20734c..7772d25cf4f 100644--- a/spec/services/notifications/create_from_journal_job_shared.rb+++ b/spec/services/notifications/create_from_journal_job_shared.rb@@ -77,7 +77,7 @@ shared_context 'with CreateFromJournalJob context' do{read_ian: false,reason: :mentioned,- read_mail_digest: false+ sent_mail: false}endlet(:notification) { FactoryBot.build_stubbed(:notification) }diff --git a/spec/services/notifications/create_from_model_service_comment_spec.rb b/spec/services/notifications/create_from_model_service_comment_spec.rbindex 36c4d605802..f8760a01247 100644--- a/spec/services/notifications/create_from_model_service_comment_spec.rb+++ b/spec/services/notifications/create_from_model_service_comment_spec.rb@@ -68,7 +68,7 @@ describe Notifications::CreateFromModelService, 'comment', with_settings: { jour{read_ian: nil,reason: false,- read_mail_digest: nil,+ sent_mail: nil,}endend@@ -111,7 +111,7 @@ describe Notifications::CreateFromModelService, 'comment', with_settings: { jourread_ian: nil,reason: false,read_mail: false,- read_mail_digest: nil,+ sent_mail: nil,}endenddiff --git a/spec/services/notifications/create_from_model_service_message_spec.rb b/spec/services/notifications/create_from_model_service_message_spec.rbindex e9582c83e07..6cd6317e6b9 100644--- a/spec/services/notifications/create_from_model_service_message_spec.rb+++ b/spec/services/notifications/create_from_model_service_message_spec.rb@@ -69,7 +69,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -111,7 +111,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -157,7 +157,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -198,7 +198,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -240,7 +240,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -286,7 +286,7 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jour{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endenddiff --git a/spec/services/notifications/create_from_model_service_news_spec.rb b/spec/services/notifications/create_from_model_service_news_spec.rbindex 2321d2a0517..8f49c4e69af 100644--- a/spec/services/notifications/create_from_model_service_news_spec.rb+++ b/spec/services/notifications/create_from_model_service_news_spec.rb@@ -61,7 +61,7 @@ describe Notifications::CreateFromModelService, 'news', with_settings: { journal{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endenddiff --git a/spec/services/notifications/create_from_model_service_wiki_spec.rb b/spec/services/notifications/create_from_model_service_wiki_spec.rbindex f2ac2f3b2aa..7cdec03710e 100644--- a/spec/services/notifications/create_from_model_service_wiki_spec.rb+++ b/spec/services/notifications/create_from_model_service_wiki_spec.rb@@ -68,7 +68,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journalread_ian: nil,reason: false,read_mail: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -117,7 +117,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journalread_ian: nil,reason: false,read_mail: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -170,7 +170,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journal{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -218,7 +218,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journal{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endend@@ -270,7 +270,7 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journal{read_ian: nil,reason: false,- read_mail_digest: nil+ sent_mail: nil}endenddiff --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 548fc12015f..fdfe013d237 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@@ -116,7 +116,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :assigned,- read_mail_digest: false+ sent_mail: false}endend@@ -134,11 +134,8 @@ describe Notifications::CreateFromModelService,let(:notification_channel_reasons) do{read_ian: nil,- reason_ian: nil,- read_mail: false,- reason_mail: :involved,- read_mail_digest: false,- reason_mail_digest: :assigned+ reason: nil,+ sent_mail: false}endend@@ -158,7 +155,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :assigned,- read_mail_digest: nil+ sent_mail: nil}endend@@ -190,7 +187,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :assigned,- read_mail_digest: false+ sent_mail: false}endend@@ -237,7 +234,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :responsible,- read_mail_digest: false+ sent_mail: false}endend@@ -256,7 +253,7 @@ describe Notifications::CreateFromModelService,{read_ian: nil,reason: nil,- read_mail_digest: false+ sent_mail: false}endend@@ -276,7 +273,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :responsible,- read_mail_digest: nil+ sent_mail: nil}endend@@ -335,7 +332,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :watched,- read_mail_digest: false+ sent_mail: false}endend@@ -354,7 +351,7 @@ describe Notifications::CreateFromModelService,{read_ian: nil,reason: nil,- read_mail_digest: false+ sent_mail: false}endend@@ -374,7 +371,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :watched,- read_mail_digest: nil+ sent_mail: nil}endend@@ -428,7 +425,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :subscribed,- read_mail_digest: false+ sent_mail: false}endend@@ -447,7 +444,7 @@ describe Notifications::CreateFromModelService,{read_ian: nil,reason: nil,- read_mail_digest: false+ sent_mail: false}endend@@ -467,7 +464,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :created,- read_mail_digest: nil+ sent_mail: nil}endend@@ -502,7 +499,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :subscribed,- read_mail_digest: false+ sent_mail: false}endend@@ -561,7 +558,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :created,- read_mail_digest: false+ sent_mail: false}endend@@ -630,7 +627,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :commented,- read_mail_digest: false+ sent_mail: false}endend@@ -688,7 +685,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :processed,- read_mail_digest: false+ sent_mail: false}endend@@ -746,7 +743,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :prioritized,- read_mail_digest: false+ sent_mail: false}endend@@ -805,7 +802,7 @@ describe Notifications::CreateFromModelService,read_ian: false,reason: :scheduled,read_mail: false,- read_mail_digest: false+ sent_mail: false}endend@@ -863,7 +860,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :scheduled,- read_mail_digest: false+ sent_mail: false}endend@@ -897,7 +894,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :assigned,- read_mail_digest: false+ sent_mail: false}endend@@ -920,7 +917,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- read_mail_digest: false+ sent_mail: false}endend@@ -953,7 +950,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- read_mail_digest: false+ sent_mail: false}endend@@ -971,7 +968,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- read_mail_digest: false+ sent_mail: false}endend@@ -986,7 +983,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- read_mail_digest: false+ sent_mail: false}endend@@ -1000,7 +997,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- read_mail_digest: false+ sent_mail: false}endend@@ -1018,7 +1015,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- read_mail_digest: false+ sent_mail: false}endend@@ -1036,7 +1033,7 @@ describe Notifications::CreateFromModelService,{read_ian: false,reason: :mentioned,- read_mail_digest: false+ sent_mail: false}endenddiff --git a/spec/services/notifications/set_attributes_service_spec.rb b/spec/services/notifications/set_attributes_service_spec.rbindex a22cd2b74ef..80bc335de58 100644--- a/spec/services/notifications/set_attributes_service_spec.rb+++ b/spec/services/notifications/set_attributes_service_spec.rb@@ -100,7 +100,7 @@ describe Notifications::SetAttributesService, type: :model dorecipient_id: 1,subject: event_subject,read_ian: false,- read_mail_digest: false+ sent_mail: false})end@@ -136,7 +136,7 @@ describe Notifications::SetAttributesService, type: :model dojournal_id: journal.id,recipient_id: 1,read_ian: false,- read_mail_digest: false+ sent_mail: false})endenddiff --git a/spec/workers/mails/reminder_job_spec.rb b/spec/workers/mails/reminder_job_spec.rbindex 2f7fd3d1dda..7d410e1c5d0 100644--- a/spec/workers/mails/reminder_job_spec.rb+++ b/spec/workers/mails/reminder_job_spec.rb@@ -89,7 +89,7 @@ describe Mails::ReminderJob, type: :model doexpect(notifications).to have_received(:update_all)- .with(read_mail_digest: true, updated_at: Time.current)+ .with(sent_mail: true, updated_at: Time.current)endit 'impersonates the recipient' do