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

additional specs

ulferts9ceb862bf319
diff --git a/spec/models/work_packages/scopes/allowed_to_spec.rb b/spec/models/work_packages/scopes/allowed_to_spec.rb
index cc54b2dea1d..6055914e5cc 100644
--- a/spec/models/work_packages/scopes/allowed_to_spec.rb
+++ b/spec/models/work_packages/scopes/allowed_to_spec.rb
@@ -146,6 +146,17 @@ RSpec.describe WorkPackage, ".allowed_to" do
end
end
+ context "when the module is inactive in the project" do
+ before do
+ public_project.enabled_modules = []
+ private_project.enabled_modules = []
+ end
+
+ it "returns no work packages" do
+ expect(subject).to be_empty
+ end
+ end
+
context "when the user is locked" do
before do
user.locked!
@@ -184,6 +195,17 @@ RSpec.describe WorkPackage, ".allowed_to" do
end
end
+ context "when the module is inactive in the project" do
+ before do
+ public_project.enabled_modules = []
+ private_project.enabled_modules = []
+ end
+
+ it "returns no work packages" do
+ expect(subject).to be_empty
+ end
+ end
+
context "when the user is locked" do
before do
user.locked!