fixed private message emails not including the message
This commit is contained in:
parent
ecf38305b4
commit
96d183a041
2 changed files with 18 additions and 6 deletions
|
|
@ -74,6 +74,10 @@ class Message < ActiveRecord::Base
|
|||
Notifications::PrivateMessage unless user.person == person
|
||||
end
|
||||
|
||||
def formatted_message(opts={})
|
||||
opts[:plain_text] ? self.text: ERB::Util.h(self.text)
|
||||
end
|
||||
|
||||
private
|
||||
def participant_of_parent_conversation
|
||||
if self.parent && !self.parent.participants.include?(self.author)
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@ describe Notifier do
|
|||
@mail.body.encoded.should include(@sm.text)
|
||||
end
|
||||
|
||||
it 'should not include translation missing' do
|
||||
@mail.body.encoded.should_not include("missing")
|
||||
it 'should not include translation fallback' do
|
||||
@mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -112,8 +112,8 @@ describe Notifier do
|
|||
@mail.body.encoded.should include(@like.author.name)
|
||||
end
|
||||
|
||||
it 'should not include translation missing' do
|
||||
@mail.body.encoded.should_not include("missing")
|
||||
it 'should not include translation fallback' do
|
||||
@mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||
end
|
||||
|
||||
it 'can handle a reshare' do
|
||||
|
|
@ -170,8 +170,8 @@ describe Notifier do
|
|||
@mail.body.encoded.should include(@cnv.messages.first.text)
|
||||
end
|
||||
|
||||
it 'should not include translation missing' do
|
||||
@mail.body.encoded.should_not include("missing")
|
||||
it 'should not include translation fallback' do
|
||||
@mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -204,6 +204,10 @@ describe Notifier do
|
|||
it "contains the original post's link" do
|
||||
comment_mail.body.encoded.include?("#{comment.post.id.to_s}").should be true
|
||||
end
|
||||
|
||||
it 'should not include translation fallback' do
|
||||
comment_mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||
end
|
||||
end
|
||||
|
||||
[:reshare, :activity_streams_photo].each do |post_type|
|
||||
|
|
@ -242,6 +246,10 @@ describe Notifier do
|
|||
it "contains the original post's link" do
|
||||
comment_mail.body.encoded.include?("#{comment.post.id.to_s}").should be true
|
||||
end
|
||||
|
||||
it 'should not include translation fallback' do
|
||||
comment_mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||
end
|
||||
end
|
||||
[:reshare, :activity_streams_photo].each do |post_type|
|
||||
context post_type.to_s do
|
||||
|
|
|
|||
Loading…
Reference in a new issue