summaryrefslogtreecommitdiff
path: root/spec/helpers/notifications_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /spec/helpers/notifications_helper_spec.rb
parent4b1de649d0168371549608993deac953eb692019 (diff)
downloadgitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/helpers/notifications_helper_spec.rb')
-rw-r--r--spec/helpers/notifications_helper_spec.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb
index 5e37e56c612..555cffba614 100644
--- a/spec/helpers/notifications_helper_spec.rb
+++ b/spec/helpers/notifications_helper_spec.rb
@@ -20,10 +20,19 @@ RSpec.describe NotificationsHelper do
end
describe '#notification_event_name' do
- it { expect(notification_event_name(:success_pipeline)).to match('Successful pipeline') }
- it { expect(notification_event_name(:failed_pipeline)).to match('Failed pipeline') }
- it { expect(notification_event_name(:fixed_pipeline)).to match('Fixed pipeline') }
- it { expect(notification_event_name(:moved_project)).to match('Moved project') }
+ context 'for success_pipeline' do
+ it 'returns the custom name' do
+ expect(FastGettext).to receive(:cached_find).with('NotificationEvent|Successful pipeline')
+ expect(notification_event_name(:success_pipeline)).to eq('Successful pipeline')
+ end
+ end
+
+ context 'for everything else' do
+ it 'returns a humanized name' do
+ expect(FastGettext).to receive(:cached_find).with('NotificationEvent|Failed pipeline')
+ expect(notification_event_name(:failed_pipeline)).to eq('Failed pipeline')
+ end
+ end
end
describe '#notification_icon_level' do