[#73887] mocked_permission_helper mirrors UserPermissibleService for empty project

It should not grant all permissions if the project argument is `nil`.
This commit is contained in:
Tobias Dillmann
2026-06-10 15:43:42 +02:00
committed by Tobias Dillmann
parent 258d17ceb4
commit 61c5224cbd
3 changed files with 5 additions and 7 deletions
@@ -67,11 +67,9 @@ RSpec.describe API::V3::WorkPackages::WorkPackageRepresenter, "rendering" do
current_user { build_stubbed(:user) }
before do
if project.present?
mock_permissions_for(current_user) do |mock|
permissions.each do |permission|
mock.allow_in_project(*permission, project:)
end
mock_permissions_for(current_user) do |mock|
permissions.each do |permission|
mock.allow_in_project(*permission, project:) if project
end
end
end