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
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.rbindex 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+ endend- 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 || "/")+ endendendenddiff --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.rbindex 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::FileInfoQuerlet(: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) doStorages::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("/")).resultendafter 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