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

Fixed unit specs for storages

Andreas Pfohl3d1e99db1028
diff --git a/modules/storages/lib/api/v3/utilities/storage_url_helper.rb b/modules/storages/lib/api/v3/utilities/storage_url_helper.rb
index 9fa02410211..9a3a659aa3f 100644
--- a/modules/storages/lib/api/v3/utilities/storage_url_helper.rb
+++ b/modules/storages/lib/api/v3/utilities/storage_url_helper.rb
@@ -71,7 +71,7 @@ module API::V3::Utilities::StorageUrlHelper
end
def make_direct_download(storage:, access_token:, file_id:)
- response = API::V3::Storages::StorageRequests
+ response = API::V3::Utilities::StorageRequests
.new(storage:)
.download_command
.call(access_token:, file_id:)
diff --git a/modules/storages/spec/requests/api/v3/file_links/file_links_spec.rb b/modules/storages/spec/requests/api/v3/file_links/file_links_spec.rb
index cf3eb15b162..1e195581c81 100644
--- a/modules/storages/spec/requests/api/v3/file_links/file_links_spec.rb
+++ b/modules/storages/spec/requests/api/v3/file_links/file_links_spec.rb
@@ -473,7 +473,7 @@ describe 'API v3 file links resource', type: :request do
describe 'GET /api/v3/file_links/:file_link_id/download' do
let(:connection_manager) { instance_double(::OAuthClients::ConnectionManager) }
- let(:request_factory) { instance_double(::API::V3::Storages::StorageRequests) }
+ let(:request_factory) { instance_double(::API::V3::Utilities::StorageRequests) }
let(:access_token_result) { ServiceResult.success(result: create(:oauth_client_token)) }
let(:path) { api_v3_paths.file_link_download(file_link.id) }
let(:download_response) { instance_double(RestClient::Response) }
@@ -484,7 +484,7 @@ describe 'API v3 file links resource', type: :request do
allow(connection_manager).to receive(:get_access_token).and_return(access_token_result)
allow(::OAuthClients::ConnectionManager).to receive(:new).and_return(connection_manager)
allow(request_factory).to receive(:download_command).and_return(->(*) { download_command_result })
- allow(::API::V3::Storages::StorageRequests).to receive(:new).and_return(request_factory)
+ allow(::API::V3::Utilities::StorageRequests).to receive(:new).and_return(request_factory)
allow(download_response).to receive(:body).and_return(response_body)
get path