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 issues_controller spec

Oliver Günthera8e380585149
diff --git a/modules/bim/app/controllers/bim/bcf/issues_controller.rb b/modules/bim/app/controllers/bim/bcf/issues_controller.rb
index d8bedcce891..6c5a33097e7 100644
--- a/modules/bim/app/controllers/bim/bcf/issues_controller.rb
+++ b/modules/bim/app/controllers/bim/bcf/issues_controller.rb
@@ -213,9 +213,16 @@ module Bim
end
def create_attachment
- Attachments::CreateService
- .new(nil, author: current_user)
- .call(uploaded_file: params[:bcf_file], description: params[:bcf_file].original_filename)
+ filename = params[:bcf_file].original_filename
+ call = Attachments::CreateService
+ .new(user: current_user)
+ .call(file: params[:bcf_file],
+ filename: filename,
+ description: filename)
+
+ call.on_failure { raise e.message }
+
+ call.result
end
def check_file_param