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

Merge branch 'dev' into feature/feature-flag-module-storages-active

Christophe Bliard94e68bc95180
diff --cc modules/storages/spec/requests/api/v3/file_links/file_links_spec.rb
index 92edbf6c7bf,41d76636477..4e2a1bc136c
--- 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
@@@ -82,9 -87,13 +88,17 @@@ describe 'API v3 file links resource',
end
end
+ context 'if storages module is deactivated for the work package\'s project' do
+ let(:project) { create(:project, disable_modules: :storages) }
+
+ it_behaves_like 'API V3 collection response', 0, 0, 'FileLink', 'Collection' do
+ let(:elements) { [] }
+ end
+ end
++
+ context 'when storages module is inactive', :disable_storages do
+ it_behaves_like 'not found'
+ end
end
describe 'POST /api/v3/work_packages/:work_package_id/file_links' do
@@@ -327,9 -334,17 +343,21 @@@
it_behaves_like 'not found'
end
+ context 'if file link is in a work package, while its project is not mapped to the file link\'s storage.' do
+ let(:path) { api_v3_paths.file_link(file_link_of_unlinked_storage.id) }
+
+ it_behaves_like 'not found'
+ end
+
+ context 'if file link is in a work package, while the storages module is deactivated in its project.' do
+ let(:project) { create(:project, disable_modules: :storages) }
+
+ it_behaves_like 'not found'
+ end
++
+ context 'when storages module is inactive', :disable_storages do
+ it_behaves_like 'not found'
+ end
end
describe 'DELETE /api/v3/file_links/:file_link_id' do