summaryrefslogtreecommitdiff
path: root/spec/mailers
diff options
context:
space:
mode:
authorPierre de La Morinerie <pierre@capitainetrain.com>2014-02-18 11:12:01 +0100
committerPierre de La Morinerie <pierre@capitainetrain.com>2014-03-03 16:58:44 +0100
commit7ba0b502d3e6fdc5efc5619d803a1b9fcf9db791 (patch)
tree7dab84048b9c766ad52c2e2349dd8535d6b99409 /spec/mailers
parent03920b96d01ea4f5267c7ccd1aa036eab17d62b4 (diff)
downloadgitlab-ce-7ba0b502d3e6fdc5efc5619d803a1b9fcf9db791.tar.gz
Add a "View in GitLab" link in notification emails
When an email notification concerns a specific object (issue, note, merge request, etc.), add a link to the footer of the email that opens the item's page in a web browser. Rationale: * The link is predictable: always the same text, always at the same location, like any reliable tool. * It allows to remove the inline-title in many emails, and leave only the actual content of the message.
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/notify_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 6ba4d97ad4a..6b8d7a6f047 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -468,6 +468,8 @@ describe Notify do
let(:example_site_path) { root_path }
let(:user) { create(:user) }
let(:compare) { Gitlab::Git::Compare.new(project.repository.raw_repository, 'cd5c4bac', 'b1e6a9db') }
+ let(:commits) { Commit.decorate(compare.commits) }
+ let(:diff_path) { project_compare_path(project, from: commits.first, to: commits.last) }
subject { Notify.repository_push_email(project.id, 'devs@company.name', user.id, 'master', compare) }
@@ -492,5 +494,9 @@ describe Notify do
it 'includes diffs' do
should have_body_text /Checkout wiki pages for installation information/
end
+
+ it 'contains a link to the diff' do
+ should have_body_text /#{diff_path}/
+ end
end
end