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
|
Notifications::PrivateMessage unless user.person == person
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def formatted_message(opts={})
|
||||||
|
opts[:plain_text] ? self.text: ERB::Util.h(self.text)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def participant_of_parent_conversation
|
def participant_of_parent_conversation
|
||||||
if self.parent && !self.parent.participants.include?(self.author)
|
if self.parent && !self.parent.participants.include?(self.author)
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,8 @@ describe Notifier do
|
||||||
@mail.body.encoded.should include(@sm.text)
|
@mail.body.encoded.should include(@sm.text)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not include translation missing' do
|
it 'should not include translation fallback' do
|
||||||
@mail.body.encoded.should_not include("missing")
|
@mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -112,8 +112,8 @@ describe Notifier do
|
||||||
@mail.body.encoded.should include(@like.author.name)
|
@mail.body.encoded.should include(@like.author.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not include translation missing' do
|
it 'should not include translation fallback' do
|
||||||
@mail.body.encoded.should_not include("missing")
|
@mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'can handle a reshare' do
|
it 'can handle a reshare' do
|
||||||
|
|
@ -170,8 +170,8 @@ describe Notifier do
|
||||||
@mail.body.encoded.should include(@cnv.messages.first.text)
|
@mail.body.encoded.should include(@cnv.messages.first.text)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not include translation missing' do
|
it 'should not include translation fallback' do
|
||||||
@mail.body.encoded.should_not include("missing")
|
@mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -204,6 +204,10 @@ describe Notifier do
|
||||||
it "contains the original post's link" do
|
it "contains the original post's link" do
|
||||||
comment_mail.body.encoded.include?("#{comment.post.id.to_s}").should be true
|
comment_mail.body.encoded.include?("#{comment.post.id.to_s}").should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should not include translation fallback' do
|
||||||
|
comment_mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
[:reshare, :activity_streams_photo].each do |post_type|
|
[:reshare, :activity_streams_photo].each do |post_type|
|
||||||
|
|
@ -242,6 +246,10 @@ describe Notifier do
|
||||||
it "contains the original post's link" do
|
it "contains the original post's link" do
|
||||||
comment_mail.body.encoded.include?("#{comment.post.id.to_s}").should be true
|
comment_mail.body.encoded.include?("#{comment.post.id.to_s}").should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should not include translation fallback' do
|
||||||
|
comment_mail.body.encoded.should_not include(I18n.translate 'notifier.a_post_you_shared')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
[:reshare, :activity_streams_photo].each do |post_type|
|
[:reshare, :activity_streams_photo].each do |post_type|
|
||||||
context post_type.to_s do
|
context post_type.to_s do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue