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

spec insufficient access

ulfertsed225b521a89
diff --git a/spec/features/projects/life_cycle/active_in_project_spec.rb b/spec/features/projects/life_cycle/active_in_project_spec.rb
index ac1b59d45df..3d0f5ddfeed 100644
--- a/spec/features/projects/life_cycle/active_in_project_spec.rb
+++ b/spec/features/projects/life_cycle/active_in_project_spec.rb
@@ -39,6 +39,14 @@ RSpec.describe "Projects life cycle settings", :js, :with_cuprite, with_flag: {
]
})
end
+ shared_let(:user_without_permission) do
+ create(:user,
+ member_with_permissions: {
+ project => %w[
+ edit_project
+ ]
+ })
+ end
shared_let(:initiating_stage) { create(:project_stage_definition, name: "Initiating") }
shared_let(:ready_to_execute_gate) { create(:project_gate_definition, name: "Ready to Execute") }
@@ -114,4 +122,14 @@ RSpec.describe "Projects life cycle settings", :js, :with_cuprite, with_flag: {
closing_stage => true)
end
end
+
+ context "without sufficient permissions" do
+ current_user { user_without_permission }
+
+ it "does not allow the user to access the page" do
+ project_life_cycle_page.visit!
+
+ project_life_cycle_page.expect_flash(message: "You are not authorized to access this page", type: :error)
+ end
+ end
end