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

Make attachment specs faster

Christophe Bliardefe267485143
diff --git a/spec/requests/api/v3/attachments/attachment_resource_shared_examples.rb b/spec/requests/api/v3/attachments/attachment_resource_shared_examples.rb
index 8799fd6eb7e..f9d6225fafb 100644
--- a/spec/requests/api/v3/attachments/attachment_resource_shared_examples.rb
+++ b/spec/requests/api/v3/attachments/attachment_resource_shared_examples.rb
@@ -191,6 +191,7 @@ RSpec.shared_examples 'an APIv3 attachment resource', content_type: :json, type:
include API::V3::Utilities::PathHelper
include FileHelpers
+ shared_let(:project) { create(:project, public: false) }
let(:current_user) { user_with_permissions }
let(:user_with_permissions) do
@@ -201,7 +202,6 @@ RSpec.shared_examples 'an APIv3 attachment resource', content_type: :json, type:
current_user
end
- let(:project) { create(:project, public: false) }
let(:role) { create(:project_role, permissions:) }
let(:attachment) { create(:attachment, container:, author:) }