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

Reformat comments and fix typos

Christophe Bliardfa89363e1a30
diff --git a/app/workers/notifications/workflow_job.rb b/app/workers/notifications/workflow_job.rb
index 8c84984cb55..d32125d7134 100644
--- a/app/workers/notifications/workflow_job.rb
+++ b/app/workers/notifications/workflow_job.rb
@@ -27,16 +27,27 @@
#++
# Governs the workflow of how journals are passed through:
-# 1) The notifications for any event (e.g. journal creation) is to be created as fast as possible
-# so that it becomes visible as an in app notification. If the resource passed in is indeed a journal,
-# it might get replaced later on (by a subsequent journal). This will lead to notifications being removed.
-# In case the notification has a mentioned-reason, the mail is to be sent right away. This accepts the possibility
-# of the journal being deleted later on.
-# 2) After the journal aggregation time has passed direct mails are scheduled.
-# This order has to be kept to ensure that the notifications are created before email sending is attempted. If it weren't
-# guaranteed, with the notifications created in one job and the mails send in another, the mail sending job might get executed
-# without any notifications being created which would result in no emails being sent at all. An alternative would be to
-# decouple notification creation and mail sending from another. But then, in app notifications being read could not prevent
+#
+# 1) The notifications for any event (e.g. journal creation) is to be created
+# as fast as possible so that it becomes visible as an in app notification.
+# If the resource passed in is indeed a journal, it might get replaced
+# later on (by a subsequent journal). This will lead to notifications being
+# removed. In case the notification has a mentioned-reason, the mail is to
+# be sent right away. This accepts the possibility of the journal being
+# deleted later on.
+#
+# 2) After the journal aggregation time has passed, direct mails are
+# scheduled.
+#
+# This order has to be kept to ensure that the notifications are created before
+# email sending is attempted.
+#
+# If it wasn't guaranteed, with the notifications created in one job and the
+# mails send in another, the mail sending job might get executed without any
+# notifications being created which would result in no emails being sent at all.
+#
+# An alternative would be to decouple notification creation and mail sending
+# from another. But then, in app notifications being read could not prevent
# mails being sent out.
class Notifications::WorkflowJob < ApplicationJob
include ::StateMachineJob
diff --git a/spec/models/work_package/work_package_visibility_spec.rb b/spec/models/work_package/work_package_visibility_spec.rb
index 259a3d2c77b..b390e8ea9d8 100644
--- a/spec/models/work_package/work_package_visibility_spec.rb
+++ b/spec/models/work_package/work_package_visibility_spec.rb
@@ -41,10 +41,10 @@ describe 'WorkPackage-Visibility', type: :model do
describe 'of public projects' do
subject { create(:work_package, project: public_project) }
- it 'is viewable by anonymous, with the view_work_packages permissison' do
+ it 'is viewable by anonymous, with the view_work_packages permission' do
# it is not really clear, where these kind of "preconditions" belong to: This setting
# is a default in Redmine::DefaultData::Loader - but this not loaded in the tests: here we
- # just make sure, that the workpackage is visible, when this permission is set
+ # just make sure, that the work package is visible, when this permission is set
Role.anonymous.add_permission! :view_work_packages
expect(WorkPackage.visible(anonymous)).to match_array [subject]
end
@@ -61,7 +61,7 @@ describe 'WorkPackage-Visibility', type: :model do
expect(WorkPackage.visible(anonymous)).to match_array []
end
- it 'is visible for members of the project, with the view_work_packages permissison' do
+ it 'is visible for members of the project, with the view_work_packages permission' do
create(:member,
user:,
project: private_project,
@@ -82,11 +82,11 @@ describe 'WorkPackage-Visibility', type: :model do
expect(WorkPackage.visible(user).pluck(:id)).to match_array [subject.id]
end
- it 'is not visible for non-members of the project without the view_work_packages permissison' do
+ it 'is not visible for non-members of the project without the view_work_packages permission' do
expect(WorkPackage.visible(user)).to match_array []
end
- it 'is not visible for members of the project, without the view_work_packages permissison' do
+ it 'is not visible for members of the project, without the view_work_packages permission' do
no_permission = create(:role, permissions: [:no_permission])
create(:member,
user:,