OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/spec/features/users/notifications/user_notifications_settings...

27 lines
679 B

require 'rails_helper'
require_relative './shared_examples'
describe "user notifications settings", type: :feature, js: true do
shared_let(:user) { FactoryBot.create :user }
let(:settings_page) { ::Pages::Notifications::Settings.new(user) }
before do
login_as current_user
settings_page.visit!
end
context 'as admin' do
let(:current_user) { FactoryBot.create :admin }
it_behaves_like 'notification settings workflow'
end
context 'as regular user' do
let(:current_user) { FactoryBot.create :user }
it 'does not allow to visit the page' do
expect(page).to have_text 'You are not authorized to access this page.'
end
end
end