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 some Todos

Christophe Bliard19c1c0dc499a
diff --git a/modules/storages/app/models/storages/project_storage.rb b/modules/storages/app/models/storages/project_storage.rb
index 387c74baaab..b6e27ac016b 100644
--- a/modules/storages/app/models/storages/project_storage.rb
+++ b/modules/storages/app/models/storages/project_storage.rb
@@ -33,7 +33,8 @@
# WorkPackages in the project.
# See also: file_link.rb and storage.rb
class Storages::ProjectStorage < ApplicationRecord
- # ToDo: Why is this necessary? Because otherwise it would be project_storages?
+ # set table name explicitly (would be guessed from model class name and be
+ # project_storages otherwise)
self.table_name = 'projects_storages'
# ProjectStorage sits between Project and Storage.
diff --git a/modules/storages/lib/open_project/storages/engine.rb b/modules/storages/lib/open_project/storages/engine.rb
index b64b274f0ac..9d018e37793 100644
--- a/modules/storages/lib/open_project/storages/engine.rb
+++ b/modules/storages/lib/open_project/storages/engine.rb
@@ -31,7 +31,9 @@
# Todo: Which is the part of the system that automatically loads the engines?
module OpenProject::Storages
class Engine < ::Rails::Engine
- # Todo: where is it used and why is it needed? (we could use the default value)
+ # engine name is used as a default prefix for module tables when generating
+ # tables with the rails command.
+ # It may also be used in other places, please investigate.
engine_name :openproject_storages
# please see comments inside ActsAsOpEngine class
diff --git a/modules/storages/spec/features/create_and_delete_project_storage_spec.rb b/modules/storages/spec/features/create_and_delete_project_storage_spec.rb
index 986c3455556..ba3c7165ca5 100644
--- a/modules/storages/spec/features/create_and_delete_project_storage_spec.rb
+++ b/modules/storages/spec/features/create_and_delete_project_storage_spec.rb
@@ -72,12 +72,6 @@ describe 'Activation of storages in projects', type: :feature, js: true do
expect(page).to have_text('Enable a file storage')
page.find('button[type=submit]').click
- # ToDo: Error message here (in the browser):
- # Project was attempted to be written but is not writable.
- # Storage was attempted to be written but is not writable.
- # Creator was attempted to be written but is not writable.
- # Also appears when executing as :admin
-
# The list of enabled file storages should now contain Storage 1
expect(page).to have_text('File storages available in this project')
expect(page).to have_text('Storage 1')
diff --git a/modules/storages/spec/models/project_storage_spec.rb b/modules/storages/spec/models/project_storage_spec.rb
index 41d3a16ae5f..82322022dd6 100644
--- a/modules/storages/spec/models/project_storage_spec.rb
+++ b/modules/storages/spec/models/project_storage_spec.rb
@@ -73,7 +73,7 @@ describe ::Storages::ProjectStorage, type: :model do
it "destroys all associated FileLink records" do
expect(Storages::ProjectStorage.count).to be 0
- # ToDo: expect(Storages::FileLink.count).to be 0
+ expect(Storages::FileLink.count).to be 0
end
end
end
diff --git a/modules/storages/spec/spec_helper.rb b/modules/storages/spec/spec_helper.rb
index d4e0de3cda8..240db10a9d1 100644
--- a/modules/storages/spec/spec_helper.rb
+++ b/modules/storages/spec/spec_helper.rb
@@ -28,9 +28,10 @@
# This is the RSpec main include file that is included in basically every test case below.
# See also: https://rspec.info/
-# ToDo: It loads factories and ??? what else?
-# -- load spec_helper from OpenProject core
+# Loads spec_helper from OpenProject core
+# This will include any support file from OpenProject core
require 'spec_helper'
+# Loads files from relative support/ directory
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }