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

Rebase and incorporate changes to CreateFolder in the tests

Marcello Rochaba191bf6be07
diff --git a/modules/storages/app/common/storages/peripherals/storage_parent_folder_extractor.rb b/modules/storages/app/common/storages/peripherals/storage_parent_folder_extractor.rb
index 5a38f9e8ac6..c139fc16ef0 100644
--- a/modules/storages/app/common/storages/peripherals/storage_parent_folder_extractor.rb
+++ b/modules/storages/app/common/storages/peripherals/storage_parent_folder_extractor.rb
@@ -26,26 +26,28 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-module Storages::Peripherals
- class ParentFolder
- attr_reader :path
+module Storages
+ module Peripherals
+ class ParentFolder
+ attr_reader :path
- def initialize(path)
- @path = path
- end
+ def initialize(path)
+ @path = path
+ end
- def root?
- @path == "/"
- end
+ def root?
+ @path == "/"
+ end
- def to_s
- @path
+ def to_s
+ @path
+ end
end
- end
- module StorageParentFolderExtractor
- def extract_parent_folder(params)
- ParentFolder.new(params[:parent].presence || "/")
+ module StorageParentFolderExtractor
+ def extract_parent_folder(params)
+ ParentFolder.new(params[:parent].presence || "/")
+ end
end
end
end
diff --git a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/file_info_query_spec.rb b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/file_info_query_spec.rb
index b166bf4d827..13921f861ae 100644
--- a/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/file_info_query_spec.rb
+++ b/modules/storages/spec/common/storages/peripherals/storage_interaction/one_drive/file_info_query_spec.rb
@@ -130,15 +130,17 @@ RSpec.describe Storages::Peripherals::StorageInteraction::OneDrive::FileInfoQuer
let(:drive_id) { "b!dmVLG22QlE2PSW0AqVB7UOhZ8n7tjkVGkgqLNnuw2ODRDvn3haLiQIhB5UYNdqMy" }
let(:permission_storage) { create(:sharepoint_dev_drive_storage, oauth_client_token_user: user, drive_id:) }
+ let(:admin_auth) { Storages::Peripherals::Registry["one_drive.authentication.userless"].call }
+
let(:folder) do
Storages::Peripherals::Registry["one_drive.commands.create_folder"]
- .call(storage: permission_storage, folder_path: "Forbidden Folder")
+ .call(storage: permission_storage, auth_strategy: admin_auth,
+ folder_name: "Forbidden Folder",
+ parent_location: Storages::Peripherals::ParentFolder.new("/"))
.result
end
after do
- admin_auth = Storages::Peripherals::Registry["one_drive.authentication.userless"].call
-
Storages::Peripherals::Registry["one_drive.commands.delete_folder"]
.call(storage: permission_storage, location: folder.id, auth_strategy: admin_auth)
end