Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

681 B
Raw Blame
# frozen_string_literal: true

require "rails_helper"
require_relative "shared_examples"

RSpec.describe "user notifications settings",
               :js do
  shared_let(:user) { create(:user) }

  let(:settings_page) { Pages::Notifications::Settings.new(user) }

  before do
    login_as current_user
    settings_page.visit!
  end

  context "as an admin" do
    let(:current_user) { create(:admin) }

    it_behaves_like "notification settings workflow"
  end

  context "as a regular user" do
    let(:current_user) { 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