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

Ensure only users with an assignable role are returned

Aaron Contrerase9eb3fcf8657
diff --git a/spec/models/principals/scopes/possible_assignee_spec.rb b/spec/models/principals/scopes/possible_assignee_spec.rb
index cf32bc50023..56f5c2eec56 100644
--- a/spec/models/principals/scopes/possible_assignee_spec.rb
+++ b/spec/models/principals/scopes/possible_assignee_spec.rb
@@ -171,6 +171,16 @@ RSpec.describe Principals::Scopes::PossibleAssignee do
end
end
end
+
+ context 'with the role not being assignable' do
+ let(:role) { non_assignable_work_package_role }
+ let(:user_status) { :active }
+
+ it 'returns nothing' do
+ expect(subject)
+ .to be_empty
+ end
+ end
end
context 'when providing a resource other than a Project or WorkPackage' do