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

Fix usage of attachment create service in documents

Oliver Günther50025487bff8
diff --git a/modules/documents/spec/models/document_spec.rb b/modules/documents/spec/models/document_spec.rb
index b76ae232342..12813cb52e9 100644
--- a/modules/documents/spec/models/document_spec.rb
+++ b/modules/documents/spec/models/document_spec.rb
@@ -86,8 +86,8 @@ describe Document do
expect do
Attachments::CreateService
- .new(valid_document, author: admin)
- .call(uploaded_file: FactoryBot.attributes_for(:attachment)[:file], description: '')
+ .new(user: admin)
+ .call(container: valid_document, file: FactoryBot.attributes_for(:attachment)[:file], filename: 'foo')
expect(valid_document.attachments.size).to eql 1
end.to(change do