Allow to toggle notifications for issues due soon
This commit is contained in:
parent
d01e5a04cc
commit
ef12973723
4 changed files with 44 additions and 0 deletions
|
@ -32,6 +32,7 @@ class NotificationSetting < ActiveRecord::Base
|
|||
:reopen_issue,
|
||||
:close_issue,
|
||||
:reassign_issue,
|
||||
:issue_due,
|
||||
:new_merge_request,
|
||||
:push_to_merge_request,
|
||||
:reopen_merge_request,
|
||||
|
|
5
changelogs/unreleased/issue_47709.yml
Normal file
5
changelogs/unreleased/issue_47709.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: 'Allow to toggle notifications for issues due soon'
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
|
@ -16,4 +16,36 @@ describe 'Projects > Show > User manages notifications', :js do
|
|||
expect(page).to have_content 'On mention'
|
||||
end
|
||||
end
|
||||
|
||||
context 'custom notification settings' do
|
||||
let(:email_events) do
|
||||
[
|
||||
:new_note,
|
||||
:new_issue,
|
||||
:reopen_issue,
|
||||
:close_issue,
|
||||
:reassign_issue,
|
||||
:issue_due,
|
||||
:new_merge_request,
|
||||
:push_to_merge_request,
|
||||
:reopen_merge_request,
|
||||
:close_merge_request,
|
||||
:reassign_merge_request,
|
||||
:merge_merge_request,
|
||||
:failed_pipeline,
|
||||
:success_pipeline
|
||||
]
|
||||
end
|
||||
|
||||
it 'shows notification settings checkbox' do
|
||||
first('.notifications-btn').click
|
||||
page.find('a[data-notification-level="custom"]').click
|
||||
|
||||
page.within('.custom-notifications-form') do
|
||||
email_events.each do |event_name|
|
||||
expect(page).to have_selector("input[name='notification_setting[#{event_name}]']")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -93,4 +93,10 @@ RSpec.describe NotificationSetting do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'email events' do
|
||||
it 'includes EXCLUDED_WATCHER_EVENTS in EMAIL_EVENTS' do
|
||||
expect(described_class::EMAIL_EVENTS).to include(*described_class::EXCLUDED_WATCHER_EVENTS)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue