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 spec after behaviour changes

Marcello Rocha033049407f3c
diff --git a/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb b/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb
index 75eee505a14..3954c02f6bf 100644
--- a/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb
+++ b/modules/storages/spec/requests/api/v3/storages/storage_files_api_spec.rb
@@ -192,12 +192,8 @@ RSpec.describe 'API v3 storage files', content_type: :json, webmock: true do
end
before do
- storage_requests = instance_double(Storages::Peripherals::StorageRequests)
- files_info_query = Proc.new do
- ServiceResult.success(result: response)
- end
- allow(storage_requests).to receive(:files_info_query).and_return(files_info_query)
- allow(Storages::Peripherals::StorageRequests).to receive(:new).and_return(storage_requests)
+ files_info_query = ->(_) { ServiceResult.success(result: response) }
+ Storages::Peripherals::Registry.stub('queries.nextcloud.files_info', files_info_query)
end
subject { last_response.body }