diff options
Diffstat (limited to 'spec/helpers/emails_helper_spec.rb')
-rw-r--r-- | spec/helpers/emails_helper_spec.rb | 22 |
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 |