gitlab-org--gitlab-foss/spec/features/profiles/user_visits_notifications_tab_spec.rb
Brett Walker 9be16e1f49 UI for disabling group/project email notification
- Adds UI to configure in group and project settings
- Removes notification configuration for users when
disabled at group or project level
2019-08-17 05:56:48 +00:00

31 lines
799 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe 'User visits the notifications tab', :js do
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
project.add_maintainer(user)
sign_in(user)
visit(profile_notifications_path)
end
it 'changes the project notifications setting' do
expect(page).to have_content('Notifications')
first('#notifications-button').click
click_link('On mention')
expect(page).to have_selector('#notifications-button', text: 'On mention')
end
context 'when project emails are disabled' do
let(:project) { create(:project, emails_disabled: true) }
it 'notification button is disabled' do
expect(page).to have_selector('.notifications-btn.disabled', visible: true)
end
end
end