Merge pull request #9738 from opf/fix/anonymous-in-meeting-mail

Remember the author for sending meeting review
pull/9747/head
Markus Kahl 3 years ago committed by GitHub
commit cca6278e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      modules/meeting/app/mailers/meeting_mailer.rb
  2. 2
      modules/meeting/app/views/meeting_mailer/content_for_review.html.erb
  3. 2
      modules/meeting/app/views/meeting_mailer/content_for_review.text.erb
  4. 4
      modules/meeting/spec/mailers/meeting_mailer_spec.rb

@ -31,6 +31,7 @@ require 'icalendar/tzinfo'
class MeetingMailer < UserMailer
def content_for_review(content, content_type, user)
@author = User.current
@meeting = content.meeting
@content_type = content_type

@ -39,7 +39,7 @@ See COPYRIGHT and LICENSE files for more details.
<p>
<%=raw t(:"text_review_#{@content_type}",
:author => h(User.current),
:author => h(@author),
:link => link_to(t(:"text_#{@content_type}_for_meeting",
:meeting => @meeting.title),
meeting_url(@meeting))) %>

@ -36,6 +36,6 @@ See COPYRIGHT and LICENSE files for more details.
<%= Meeting.human_attribute_name(:participants_attended) %>: <%= @meeting.participants.attended.sort.join("; ") %>
<%=t(:"text_review_#{@content_type}",
:author => User.current,
:author => @author,
:link => t(:"text_#{@content_type}_for_meeting",
:meeting => @meeting.title) + " (#{meeting_url(@meeting)})") %>

@ -50,6 +50,8 @@ describe MeetingMailer, type: :mailer do
end
before do
User.current = author
meeting.participants.merge([meeting.participants.build(user: watcher1, invited: true, attended: false),
meeting.participants.build(user: watcher2, invited: true, attended: false)])
meeting.save!
@ -159,7 +161,9 @@ describe MeetingMailer, type: :mailer do
it 'renders the mail with the correcet locale' do
expect(mail.text_part.body).to include('01/19/2021 07:00 PM-08:00 PM (GMT+09:00) Asia/Tokyo')
expect(mail.text_part.body).to include("#{author.name} has put the")
expect(mail.html_part.body).to include('01/19/2021 07:00 PM-08:00 PM (GMT+09:00) Asia/Tokyo')
expect(mail.html_part.body).to include("#{author.name} has put the")
expect(mail.to).to match_array([watcher1.mail])
end

Loading…
Cancel
Save