Remove unused From headers

It is already added in the default_headers
This commit is contained in:
Benjamin Neff 2017-02-16 01:58:19 +01:00
parent 97c351c7b4
commit eac8c7572c
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
4 changed files with 5 additions and 6 deletions

View file

@ -7,7 +7,6 @@ module NotificationMailers
@comment = Comment.find_by_id(comment_id)
if mail?
@headers[:from] = "\"#{@comment.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>"
@headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>"
if @comment.public?
@headers[:subject] = "Re: #{@comment.comment_email_subject}"

View file

@ -5,7 +5,6 @@ module NotificationMailers
def set_headers(comment_id)
@comment = Comment.find(comment_id)
@headers[:from] = "\"#{@comment.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>"
@headers[:in_reply_to] = @headers[:references] = "<#{@comment.parent.guid}@#{AppConfig.pod_uri.host}>"
if @comment.public?
@headers[:subject] = "Re: #{@comment.comment_email_subject}"

View file

@ -3,11 +3,10 @@ module NotificationMailers
attr_accessor :message, :conversation, :participants
def set_headers(message_id)
@message = Message.find_by_id(message_id)
@message = Message.find_by_id(message_id)
@conversation = @message.conversation
@participants = @conversation.participants
@headers[:from] = "\"#{@message.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>"
@headers[:subject] = I18n.t("notifier.private_message.subject")
@headers[:in_reply_to] = @headers[:references] = "<#{@conversation.guid}@#{AppConfig.pod_uri.host}>"
end

View file

@ -281,7 +281,9 @@ describe Notifier, type: :mailer do
let(:comment) { eve.comment!(commented_post, "Totally is") }
describe ".comment_on_post" do
let(:comment_mail) { Notifier.send_notification("comment_on_post", bob.id, person.id, comment.id).deliver_now }
let(:comment_mail) {
Notifier.send_notification("comment_on_post", bob.id, eve.person.id, comment.id).deliver_now
}
it "TO: goes to the right person" do
expect(comment_mail.to).to eq([bob.email])
@ -322,7 +324,7 @@ describe Notifier, type: :mailer do
end
describe ".also_commented" do
let(:comment_mail) { Notifier.send_notification("also_commented", bob.id, person.id, comment.id) }
let(:comment_mail) { Notifier.send_notification("also_commented", bob.id, eve.person.id, comment.id) }
it "TO: goes to the right person" do
expect(comment_mail.to).to eq([bob.email])