Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-04-12 19:39:40 +0300
committerDouwe Maan <douwe@gitlab.com>2016-04-12 19:39:40 +0300
commit4516f40dfe7167417280391d2cd7f12772c3eda5 (patch)
treec3859ffb92673088aeee3b208efa6e7607330b60 /spec/helpers
parent2082879d2f3f91b038863f7c67c658d678924564 (diff)
parent61a62e00e3b08e6ed962b029564e3a2446e169fd (diff)
Merge branch 'decouple-member-notification' into 'master'
Decouple membership and notifications This allow you to have notification setting per project even if you are member of group. It also creates background for having notification settings in project you are not member of. - [x] Make it work - [x] Migrations - [x] CHANGELOG - [x] More tests - [x] API For #3359 After this merge request there is still some work to be done: * create migration that remove duplicates in notification settings table and create uniq index (8.8 probably) * remove notification_level field from Member model in 9.0 * make proper API for notification settings * use `MemberCreateService` instead of Member#after_create callback for creating notification settings (after #14709) * maybe more tests Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> See merge request !3421
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/notifications_helper_spec.rb37
1 files changed, 9 insertions, 28 deletions
diff --git a/spec/helpers/notifications_helper_spec.rb b/spec/helpers/notifications_helper_spec.rb
index f1aba4cfdf3..9d5f009ebe1 100644
--- a/spec/helpers/notifications_helper_spec.rb
+++ b/spec/helpers/notifications_helper_spec.rb
@@ -2,34 +2,15 @@ require 'spec_helper'
describe NotificationsHelper do
describe 'notification_icon' do
- let(:notification) { double(disabled?: false, participating?: false, watch?: false) }
-
- context "disabled notification" do
- before { allow(notification).to receive(:disabled?).and_return(true) }
-
- it "has a red icon" do
- expect(notification_icon(notification)).to match('class="fa fa-volume-off ns-mute"')
- end
- end
-
- context "participating notification" do
- before { allow(notification).to receive(:participating?).and_return(true) }
-
- it "has a blue icon" do
- expect(notification_icon(notification)).to match('class="fa fa-volume-down ns-part"')
- end
- end
-
- context "watched notification" do
- before { allow(notification).to receive(:watch?).and_return(true) }
-
- it "has a green icon" do
- expect(notification_icon(notification)).to match('class="fa fa-volume-up ns-watch"')
- end
- end
+ it { expect(notification_icon(: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"') }
+ it { expect(notification_icon(:watch)).to match('class="fa fa-eye fa-fw"') }
+ end
- it "has a blue icon" do
- expect(notification_icon(notification)).to match('class="fa fa-circle-o ns-default"')
- end
+ describe 'notification_title' do
+ it { expect(notification_title(:watch)).to match('Watch') }
+ it { expect(notification_title(:mention)).to match('On mention') }
end
end