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
Remove content_type from ics invite
Oliver Güntheref059505df11
diff --git a/modules/meeting/app/mailers/meeting_mailer.rb b/modules/meeting/app/mailers/meeting_mailer.rbindex dc649ccf9f0..e6b6abb11a1 100644--- a/modules/meeting/app/mailers/meeting_mailer.rb+++ b/modules/meeting/app/mailers/meeting_mailer.rb@@ -57,9 +57,8 @@ class MeetingMailer < UserMailerendend- def icalendar_notification(meeting, content_type, user)+ def icalendar_notification(meeting, user, _actor, **)@meeting = meeting- @content_type = content_typeset_headers @meetingdiff --git a/modules/meeting/app/services/meeting_notification_service.rb b/modules/meeting/app/services/meeting_notification_service.rbindex 80cc0c76dd3..ec08d5fb568 100644--- a/modules/meeting/app/services/meeting_notification_service.rb+++ b/modules/meeting/app/services/meeting_notification_service.rb@@ -12,14 +12,14 @@ class MeetingNotificationServiceprivate- def send_notifications!(action, include_author:, **params)+ def send_notifications!(action, include_author:, **)author_mail = meeting.author.mailrecipients_with_errors = []meeting.participants.includes(:user).find_each do |recipient|next if recipient.mail == author_mail && !include_author- MeetingMailer.send(action, meeting, recipient.user, User.current, **params).deliver_later+ MeetingMailer.send(action, meeting, recipient.user, User.current, **).deliver_laterrescue StandardError => eRails.logger.error do"Failed to deliver #{action} notification to #{recipient.mail}: #{e.message}"diff --git a/modules/meeting/spec/controllers/meeting_contents_controller_spec.rb b/modules/meeting/spec/controllers/meeting_contents_controller_spec.rbindex d2a656e42a6..18d4d4b4c4b 100644--- a/modules/meeting/spec/controllers/meeting_contents_controller_spec.rb+++ b/modules/meeting/spec/controllers/meeting_contents_controller_spec.rb@@ -36,7 +36,12 @@ RSpec.describe MeetingContentsController doshared_let(:watcher2) { create(:user, member_with_roles: { project => role }) }shared_let(:meeting) doUser.execute_as author do- create(:meeting, author:, project:)+ meeting = build(:meeting, author:, project:)+ meeting.participants.build(user: watcher1, invited: true, attended: false)+ meeting.participants.build(user: watcher2, invited: true, attended: false)++ meeting.save!+ meetingendendshared_let(:meeting_agenda) do@@ -49,9 +54,6 @@ RSpec.describe MeetingContentsController doActionMailer::Base.deliveries = []allow_any_instance_of(MeetingContentsController).to receive(:find_content)allow(controller).to receive(:authorize)- meeting.participants.merge([meeting.participants.build(user: watcher1, invited: true, attended: false),- meeting.participants.build(user: watcher2, invited: true, attended: false)])- meeting.save!controller.instance_variable_set(:@content, meeting_agenda.meeting.agenda)controller.instance_variable_set(:@content_type, 'meeting_agenda')end@@ -59,7 +61,11 @@ RSpec.describe MeetingContentsController doshared_examples_for 'delivered by mail' dobefore { put action, params: { meeting_id: meeting.id } }- it { expect(ActionMailer::Base.deliveries.count).to eql(mail_count) }+ it 'submits the mails' do+ perform_enqueued_jobs++ expect(ActionMailer::Base.deliveries.count).to eql(mail_count)+ endenddescribe 'PUT' do@@ -76,7 +82,7 @@ RSpec.describe MeetingContentsController docontext 'with an error during deliver' dobefore do- allow(MeetingMailer).to receive(:content_for_review).and_raise(Net::SMTPError)+ allow(MeetingMailer).to receive(:invited).and_raise(Net::SMTPError)endit 'does not raise an error' do@@ -84,7 +90,7 @@ RSpec.describe MeetingContentsController doendit 'produces a flash message containing the mail addresses raising the error' do- put 'notify', params: { meeting_id: meeting.id }+ put 'notify', params: { meeting_id: meeting.id }meeting.participants.each do |participant|expect(flash[:error]).to include(participant.name)end@@ -106,7 +112,7 @@ RSpec.describe MeetingContentsController docontext 'with an error during deliver' dobefore doauthor.save!- allow(MeetingMailer).to receive(:content_for_review).and_raise(Net::SMTPError)+ allow(MeetingMailer).to receive(:invited).and_raise(Net::SMTPError)endit 'does not raise an error' do