diff --git a/app/models/comment.rb b/app/models/comment.rb index c07e003..10205eb 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -81,6 +81,8 @@ class Comment < ActiveRecord::Base :sender_link => comment.author_link, :article_title => comment.article.name, :comment_url => comment.url, + :comment_title => comment.title, + :comment_body => comment.body, :environment => profile.environment.name, :url => profile.environment.top_url end diff --git a/app/views/comment/notifier/mail.rhtml b/app/views/comment/notifier/mail.rhtml index 591789d..5fd6d71 100644 --- a/app/views/comment/notifier/mail.rhtml +++ b/app/views/comment/notifier/mail.rhtml @@ -2,9 +2,18 @@ <%= word_wrap(_('%{sender} (%{sender_link}) created a new comment on your article "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %> +<%= word_wrap(_('Title: %s') % @comment_title) %> + +<%= _("Comment:") %> +------------------------------------------------------------------------------- +<%= word_wrap(@comment_body) %> +------------------------------------------------------------------------------- + <%= _('Access the address below to view this comment:') %> <%= url_for @comment_url %> +<%= _("Greetings,") %> + -- -<%= _('%s environment system') % @environment %> +<%= _('%s team.') % @environment %> <%= url_for @url %> diff --git a/test/unit/comment_notifier_test.rb b/test/unit/comment_notifier_test.rb index 1327d1e..b4a7a38 100644 --- a/test/unit/comment_notifier_test.rb +++ b/test/unit/comment_notifier_test.rb @@ -44,6 +44,18 @@ class CommentNotifierTest < Test::Unit::TestCase end end + should 'include comment title in the e-mail' do + @article.comments << Comment.new(:author => @profile, :title => 'comment title', :body => 'comment title') + sent = ActionMailer::Base.deliveries.first + assert_match /comment title/, sent.body + end + + should 'include comment text in the e-mail' do + @article.comments << Comment.new(:author => @profile, :title => 'comment title', :body => 'comment body') + sent = ActionMailer::Base.deliveries.first + assert_match /comment body/, sent.body + end + private def read_fixture(action) -- libgit2 0.21.2