summaryrefslogtreecommitdiff
path: root/spec/helpers/emails_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-04 21:07:31 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-04 21:07:31 +0000
commit71221554dd9ddf30f73035c89f78164e001aa96d (patch)
treec56e0b2fc3dd16602183b78cb3f68aed211c5e77 /spec/helpers/emails_helper_spec.rb
parentb41cd8cb92d53454b2b160ba922d33801933a9cf (diff)
downloadgitlab-ce-71221554dd9ddf30f73035c89f78164e001aa96d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers/emails_helper_spec.rb')
-rw-r--r--spec/helpers/emails_helper_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/helpers/emails_helper_spec.rb b/spec/helpers/emails_helper_spec.rb
index 931b7008173..0ff9080ef94 100644
--- a/spec/helpers/emails_helper_spec.rb
+++ b/spec/helpers/emails_helper_spec.rb
@@ -74,6 +74,28 @@ describe EmailsHelper do
end
end
+ describe 'notification_reason_text' do
+ subject { helper.notification_reason_text(reason_code) }
+
+ using RSpec::Parameterized::TableSyntax
+
+ where(:reason_code, :reason_text) do
+ NotificationReason::OWN_ACTIVITY | ' of your activity '
+ NotificationReason::ASSIGNED | ' you have been assigned an item '
+ NotificationReason::MENTIONED | ' you have been mentioned '
+ "" | ' of your account '
+ nil | ' of your account '
+ end
+
+ with_them do
+ it { is_expected.to start_with "You're receiving this email because" }
+
+ it { is_expected.to include reason_text }
+
+ it { is_expected.to end_with "on #{Gitlab.config.gitlab.host}." }
+ end
+ end
+
describe 'sanitize_name' do
context 'when name contains a valid URL string' do
it 'returns name with `.` replaced with `_` to prevent mail clients from auto-linking URLs' do