diff options
author | Alex Groleau <agroleau@gitlab.com> | 2019-08-27 12:41:39 -0400 |
---|---|---|
committer | Alex Groleau <agroleau@gitlab.com> | 2019-08-27 12:41:39 -0400 |
commit | aa01f092829facd1044ad02f334422b7dbdc8b0e (patch) | |
tree | a754bf2497820432df7da0f2108bb7527a8dd7b8 /spec/helpers/notifications_helper_spec.rb | |
parent | a1d9c9994a9a4d79b824c3fd9322688303ac8b03 (diff) | |
parent | 6b10779053ff4233c7a64c5ab57754fce63f6710 (diff) | |
download | gitlab-ce-runner-metrics-extractor.tar.gz |
Merge branch 'master' of gitlab_gitlab:gitlab-org/gitlab-cerunner-metrics-extractor
Diffstat (limited to 'spec/helpers/notifications_helper_spec.rb')
-rw-r--r-- | spec/helpers/notifications_helper_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb index 9ecaabc04ed..5717b15d656 100644 --- a/spec/helpers/notifications_helper_spec.rb +++ b/spec/helpers/notifications_helper_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' describe NotificationsHelper do describe 'notification_icon' do it { expect(notification_icon(:disabled)).to match('class="fa fa-microphone-slash fa-fw"') } + it { expect(notification_icon(:owner_disabled)).to match('class="fa fa-microphone-slash fa-fw"') } it { expect(notification_icon(:participating)).to match('class="fa fa-volume-up fa-fw"') } it { expect(notification_icon(:mention)).to match('class="fa fa-at fa-fw"') } it { expect(notification_icon(:global)).to match('class="fa fa-globe fa-fw"') } @@ -19,4 +20,14 @@ describe NotificationsHelper do it { expect(notification_event_name(:success_pipeline)).to match('Successful pipeline') } it { expect(notification_event_name(:failed_pipeline)).to match('Failed pipeline') } end + + describe '#notification_icon_level' do + let(:user) { create(:user) } + let(:global_setting) { user.global_notification_setting } + let(:notification_setting) { create(:notification_setting, level: :watch) } + + it { expect(notification_icon_level(notification_setting, true)).to eq 'owner_disabled' } + it { expect(notification_icon_level(notification_setting)).to eq 'watch' } + it { expect(notification_icon_level(global_setting)).to eq 'participating' } + end end |