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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#44856] Fixed specs
Andreas Pfohl81ef0701eb62
diff --git a/modules/storages/app/common/storages/peripherals/storage_error_helper.rb b/modules/storages/app/common/storages/peripherals/storage_error_helper.rbindex 34a0c84a17c..b91bf14738c 100644--- a/modules/storages/app/common/storages/peripherals/storage_error_helper.rb+++ b/modules/storages/app/common/storages/peripherals/storage_error_helper.rb@@ -35,7 +35,7 @@ module Storages::Peripheralswhen :not_foundraise API::Errors::NotFound.newwhen :bad_request- raise API::Errors::BadRequest.new("Malformed body.")+ raise API::Errors::BadRequest.new(error.log_message)elseraise API::Errors::InternalError.newenddiff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/upload_link_query_helpers.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/upload_link_query_helpers.rbindex 02221651132..447907f893c 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/upload_link_query_helpers.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/upload_link_query_helpers.rb@@ -36,7 +36,9 @@ module Storages::Peripherals::StorageInteractionauthorize(:manage_file_links, context: Project.find(project_id))ServiceResult.success(result: { fileName: file_name, parent: }.transform_keys(&:to_s))else- ServiceResult.failure(errors: :bad_request)+ ServiceResult.failure(+ errors: Storages::StorageError.new(code: :bad_request, log_message: 'Request body malformed!')+ )endenddiff --git a/modules/storages/spec/common/peripherals/storage_requests_spec.rb b/modules/storages/spec/common/peripherals/storage_requests_spec.rbindex 903b9932641..a8639f3021f 100644--- a/modules/storages/spec/common/peripherals/storage_requests_spec.rb+++ b/modules/storages/spec/common/peripherals/storage_requests_spec.rb@@ -346,7 +346,7 @@ describe Storages::Peripherals::StorageRequests, webmock: true do}.to_json)stub_request(:put, "#{url}/ocs/v2.php/apps/files_sharing/api/v1/shares/#{share_id}")- .with(body: { permissions: 4 })+ .with(body: { permissions: 5 }).to_return(status: 200, body: {}.to_json)end@@ -430,7 +430,7 @@ describe Storages::Peripherals::StorageRequests, webmock: true dodescribe 'with second outbound request returning 200 and an empty body' dobefore dostub_request(:put, "#{url}/ocs/v2.php/apps/files_sharing/api/v1/shares/#{share_id}")- .with(body: { permissions: 4 })+ .with(body: { permissions: 5 }).to_return(status: 200)enddiff --git a/modules/storages/spec/requests/api/v3/storages/storage_files_spec.rb b/modules/storages/spec/requests/api/v3/storages/storage_files_spec.rbindex 2ae8397a6c2..9fa9a3d122d 100644--- a/modules/storages/spec/requests/api/v3/storages/storage_files_spec.rb+++ b/modules/storages/spec/requests/api/v3/storages/storage_files_spec.rb@@ -176,9 +176,10 @@ describe 'API v3 storage files', content_type: :json, webmock: true doenddescribe 'POST /api/v3/storages/:storage_id/files/prepare_upload', with_flag: { storage_file_upload: true } do+ let(:permissions) { %i(view_work_packages view_file_links manage_file_links) }let(:path) { api_v3_paths.prepare_upload(storage.id) }let(:upload_link) { Storages::UploadLink.new('https://example.com/upload/xyz123') }- let(:body) { { fileName: "ape.png", parent: "/Pictures" }.to_json }+ let(:body) { { fileName: "ape.png", parent: "/Pictures", projectId: project.id }.to_json }subject(:last_response) dopost(path, body)@@ -203,7 +204,7 @@ describe 'API v3 storage files', content_type: :json, webmock: true doendit { is_expected.to be_json_eql(upload_link.destination.to_json).at_path('_links/destination/href') }- it { is_expected.to be_json_eql("post".to_json).at_path('_links/destination/method') }+ it { is_expected.to be_json_eql("put".to_json).at_path('_links/destination/method') }it { is_expected.to be_json_eql("Upload File".to_json).at_path('_links/destination/title') }end