Improved some minor things in the storage requests part

pull/11315/head
Andreas Pfohl 2 years ago
parent 2554e265c4
commit 5f1c629fe4
No known key found for this signature in database
GPG Key ID: FF58F3B771328EB4
  1. 10
      modules/storages/lib/api/v3/utilities/storage_interaction/nextcloud_storage_query.rb
  2. 4
      modules/storages/lib/api/v3/utilities/storage_interaction/storage_queries.rb
  3. 2
      modules/storages/spec/lib/api/v3/utilities/storage_requests_spec.rb

@ -92,9 +92,13 @@ module API::V3::Utilities::StorageInteraction
end
def name(element)
element
.xpath('d:href')
.map(&:inner_text)
texts = element
.xpath('d:href')
.map(&:inner_text)
return nil if texts.empty?
texts
.first
.delete_prefix(@base_path)
.delete_suffix('/')

@ -19,8 +19,8 @@ module API::V3::Utilities::StorageInteraction
result:
::API::V3::Utilities::StorageInteraction::NextcloudStorageQuery.new(
base_uri: @uri,
origin_user_id: token.send(:origin_user_id),
token: token.send(:access_token),
origin_user_id: token.origin_user_id,
token: token.access_token,
with_refreshed_token: connection_manager.method(:with_refreshed_token).to_proc
)
)

@ -121,7 +121,7 @@ describe API::V3::Utilities::StorageRequests, webmock: true do
.to_return(status: 207, body: xml, headers: {})
end
describe 'files_query' do
describe '#files_query' do
describe 'with Nextcloud storage type selected' do
it 'must return a list of files when called' do
subject

Loading…
Cancel
Save