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
[#43675] fix specs
Dmitrii0c85cc428742
diff --git a/app/seeders/admin_user_seeder.rb b/app/seeders/admin_user_seeder.rbindex 29470a0049b..c531b4f8bfd 100644--- a/app/seeders/admin_user_seeder.rb+++ b/app/seeders/admin_user_seeder.rb@@ -55,7 +55,7 @@ class AdminUserSeeder < Seederuser.language = I18n.locale.to_suser.status = User.statuses[:active]user.force_password_change = force_password_change?- user.notification_settings.build(involved: true, mentioned: true, watched: true)+ user.notification_settings.build(assignee: true, responsible: true, mentioned: true, watched: true)endenddiff --git a/app/seeders/development_data/users_seeder.rb b/app/seeders/development_data/users_seeder.rbindex 8cac0c2d16d..d40985a6fa6 100644--- a/app/seeders/development_data/users_seeder.rb+++ b/app/seeders/development_data/users_seeder.rb@@ -103,7 +103,7 @@ module DevelopmentDatauser.status = User.statuses[:active]user.language = I18n.localeuser.force_password_change = false- user.notification_settings.build(involved: true, mentioned: true, watched: true)+ user.notification_settings.build(assignee: true, responsible: true, mentioned: true, watched: true)endenddiff --git a/app/services/users/set_attributes_service.rb b/app/services/users/set_attributes_service.rbindex 75ff215f438..9c2dc80bbae 100644--- a/app/services/users/set_attributes_service.rb+++ b/app/services/users/set_attributes_service.rb@@ -62,7 +62,7 @@ module Usersenddef initialize_notification_settings- model.notification_settings.build(involved: true, mentioned: true, watched: true)+ model.notification_settings.build(assignee: true, responsible: true, mentioned: true, watched: true)end# rubocop:disable Metrics/AbcSizediff --git a/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.html b/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.htmlindex 3aa7ed212d2..9bbd16fb3d1 100644--- a/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.html+++ b/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.html@@ -30,15 +30,29 @@</tr><tr><th class="op-table--cell op-table--cell_soft-heading">- <h5>{{ text.involved_header.title }}</h5>- <p>{{ text.involved_header.description }}</p>+ <h5>{{ text.assignee }}</h5></th><ng-container *ngFor="let item of settings.controls"><td class="op-table--cell" [formGroup]="item"><inputtype="checkbox"- formControlName="involved"- data-qa-project-notification-type="involved"+ formControlName="assignee"+ data-qa-project-notification-type="assignee"+ [attr.data-qa-project]="item.controls.project.value.title"+ />+ </td>+ </ng-container>+ </tr>+ <tr>+ <th class="op-table--cell op-table--cell_soft-heading">+ <h5>{{ text.responsible }}</h5>+ </th>+ <ng-container *ngFor="let item of settings.controls">+ <td class="op-table--cell" [formGroup]="item">+ <input+ type="checkbox"+ formControlName="responsible"+ data-qa-project-notification-type="responsible"[attr.data-qa-project]="item.controls.project.value.title"/></td>diff --git a/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.ts b/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.tsindex 38cd81fc1c3..28dfd1faf08 100644--- a/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.ts+++ b/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.ts@@ -9,7 +9,6 @@ import { FormArray, FormGroup, FormControl } from '@angular/forms';import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';import { I18nService } from 'core-app/core/i18n/i18n.service';import idFromLink from 'core-app/features/hal/helpers/id-from-link';-import { UserPreferencesService } from 'core-app/features/user-preferences/state/user-preferences.service';import { HalSourceLink } from 'core-app/features/hal/resources/hal-resource';@Component({@@ -30,10 +29,8 @@ export class NotificationSettingsTableComponent {title: this.I18n.t('js.notifications.settings.reasons.mentioned.title'),description: this.I18n.t('js.notifications.settings.reasons.mentioned.description'),},- involved_header: {- title: this.I18n.t('js.notifications.settings.reasons.involved.title'),- description: this.I18n.t('js.notifications.settings.reasons.involved.description'),- },+ assignee: this.I18n.t('js.notifications.settings.reasons.assignee'),+ responsible: this.I18n.t('js.notifications.settings.reasons.responsible'),watched_header: this.I18n.t('js.notifications.settings.reasons.watched'),work_package_commented_header: this.I18n.t('js.notifications.settings.reasons.work_package_commented'),work_package_created_header: this.I18n.t('js.notifications.settings.reasons.work_package_created'),@@ -55,7 +52,8 @@ export class NotificationSettingsTableComponent {addProjectSettings(project:HalSourceLink):void {this.settings.push(new FormGroup({project: new FormControl(project),- involved: new FormControl(false),+ assignee: new FormControl(false),+ responsible: new FormControl(false),workPackageCreated: new FormControl(false),workPackageProcessed: new FormControl(false),workPackageScheduled: new FormControl(false),diff --git a/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb b/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rbindex cf8eb98141b..e5829200fa9 100644--- a/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb+++ b/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb@@ -68,10 +68,10 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jouendend- context 'with the user having registered for involved notifications' do+ context 'with the user having registered for assignee and responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]end@@ -116,10 +116,10 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jouendend- context 'with the user having registered for involved notifications' do+ context 'with the user having registered for assignee and responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]enddiff --git a/spec/features/notifications/reminder_mail_spec.rb b/spec/features/notifications/reminder_mail_spec.rbindex cd1cd2dfec9..b58757d0a8a 100644--- a/spec/features/notifications/reminder_mail_spec.rb+++ b/spec/features/notifications/reminder_mail_spec.rb@@ -36,7 +36,8 @@ describe "Reminder email sending", type: :feature, js: true do},notification_settings: [build(:notification_setting,- involved: true,+ assignee: true,+ responsible: true,watched: true,mentioned: true,work_package_commented: true,diff --git a/spec/features/users/notifications/shared_examples.rb b/spec/features/users/notifications/shared_examples.rbindex 17ea5bde9df..7eeb576b23d 100644--- a/spec/features/users/notifications/shared_examples.rb+++ b/spec/features/users/notifications/shared_examples.rb@@ -15,7 +15,8 @@ shared_examples 'notification settings workflow' dosettings_page.add_project project_alt# Set settings for project email- settings_page.configure_global involved: true,+ settings_page.configure_global assignee: true,+ responsible: true,work_package_commented: true,work_package_created: true,work_package_processed: true,@@ -24,7 +25,8 @@ shared_examples 'notification settings workflow' do# Set settings for project emailsettings_page.configure_project project: project,- involved: true,+ assignee: true,+ responsible: true,work_package_commented: false,work_package_created: false,work_package_processed: false,@@ -39,7 +41,8 @@ shared_examples 'notification settings workflow' doexpect(notification_settings.where(project:).count).to eq 1project_settings = notification_settings.find_by(project:)- expect(project_settings.involved).to be_truthy+ expect(project_settings.assignee).to be_truthy+ expect(project_settings.responsible).to be_truthyexpect(project_settings.mentioned).to be_truthyexpect(project_settings.watched).to be_truthyexpect(project_settings.work_package_commented).to be_falseydiff --git a/spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rb b/spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rbindex 892a9547810..d6745ee8f97 100644--- a/spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rb+++ b/spec/lib/api/v3/user_preferences/user_preference_representer_parsing_spec.rb@@ -43,7 +43,8 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,{'notifications' => [{- 'involved' => true,+ 'assignee' => true,+ 'responsible' => true,'_links' => {'project' => {'href' => '/api/v3/projects/1'@@ -51,7 +52,8 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,}},{- 'involved' => false,+ 'assignee' => false,+ 'responsible' => false,'mentioned' => true,'_links' => {'project' => {@@ -69,11 +71,13 @@ describe ::API::V3::UserPreferences::UserPreferenceRepresenter,in_project, global = subject.notification_settingsexpect(in_project[:project_id]).to eq "1"- expect(in_project[:involved]).to be_truthy+ expect(in_project[:assignee]).to be_truthy+ expect(in_project[:responsible]).to be_truthyexpect(in_project[:mentioned]).to be_nilexpect(global[:project_id]).to be_nil- expect(global[:involved]).to be false+ expect(global[:assignee]).to be_falsey+ expect(global[:responsible]).to be_falseyexpect(global[:mentioned]).to be trueendenddiff --git a/spec/models/mail_handler_spec.rb b/spec/models/mail_handler_spec.rbindex 5ccc3708116..314a02df2f1 100644--- a/spec/models/mail_handler_spec.rb+++ b/spec/models/mail_handler_spec.rb@@ -1071,7 +1071,7 @@ describe MailHandler, type: :model doassignee = create(:user,member_in_project: project,member_with_permissions: %i(view_work_packages),- notification_settings: [build(:notification_setting, involved: true)])+ notification_settings: [build(:notification_setting, assignee: true, responsible: true)])work_package.update_column(:assigned_to_id, assignee.id)diff --git a/spec/services/notifications/create_from_model_service_comment_spec.rb b/spec/services/notifications/create_from_model_service_comment_spec.rbindex a65cc255322..e651be0b59b 100644--- a/spec/services/notifications/create_from_model_service_comment_spec.rb+++ b/spec/services/notifications/create_from_model_service_comment_spec.rb@@ -73,10 +73,10 @@ describe Notifications::CreateFromModelService, 'comment', with_settings: { jourendend- context 'with the user having registered for involved notifications' do+ context 'with the user having registered for assignee and responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_message_spec.rb b/spec/services/notifications/create_from_model_service_message_spec.rbindex 8be43a0c014..1ffec2fd7ce 100644--- a/spec/services/notifications/create_from_model_service_message_spec.rb+++ b/spec/services/notifications/create_from_model_service_message_spec.rb@@ -74,10 +74,10 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jourendend- context 'with the user having registered for involved notifications' do+ context 'with the user having registered for assignee and responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]end@@ -206,10 +206,10 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jourendend- context 'with the user having registered for involved notifications' do+ context 'with the user having registered for assignee and responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_news_spec.rb b/spec/services/notifications/create_from_model_service_news_spec.rbindex b8d3fa9c904..574632496ec 100644--- a/spec/services/notifications/create_from_model_service_news_spec.rb+++ b/spec/services/notifications/create_from_model_service_news_spec.rb@@ -66,10 +66,10 @@ describe Notifications::CreateFromModelService, 'news', with_settings: { journalendend- context 'with the user having registered for involved notifications' do+ context 'with the user having registered for assignee and responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_wiki_spec.rb b/spec/services/notifications/create_from_model_service_wiki_spec.rbindex 7471a0bf2fb..639425c4105 100644--- a/spec/services/notifications/create_from_model_service_wiki_spec.rb+++ b/spec/services/notifications/create_from_model_service_wiki_spec.rb@@ -72,10 +72,10 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journalendend- context 'with the user having registered for involved notifications' do+ context 'with the user having registered for assignee and responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]end@@ -165,10 +165,10 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journalendend- context 'with the user having registered for involved notifications' do+ context 'with the user having registered for assignee and responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_work_package_spec.rb b/spec/services/notifications/create_from_model_service_work_package_spec.rbindex 57d8d815100..212ba90dd08 100644--- a/spec/services/notifications/create_from_model_service_work_package_spec.rb+++ b/spec/services/notifications/create_from_model_service_work_package_spec.rb@@ -103,7 +103,7 @@ describe Notifications::CreateFromModelService,let(:user_property) { :assigned_to }let(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]end@@ -147,10 +147,10 @@ describe Notifications::CreateFromModelService,it_behaves_like 'creates no notification'end- context 'when assignee has all in app notifications enabled but only involved for mail' do+ context 'when assignee has all in app notifications enabled but only assignee for mail' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]end@@ -194,7 +194,7 @@ describe Notifications::CreateFromModelService,let(:user_property) { :responsible }let(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(involved: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))]enddiff --git a/spec/services/notifications/mail_service_mentioned_integration_spec.rb b/spec/services/notifications/mail_service_mentioned_integration_spec.rbindex 0cba2953ca5..cbb9b1be65e 100644--- a/spec/services/notifications/mail_service_mentioned_integration_spec.rb+++ b/spec/services/notifications/mail_service_mentioned_integration_spec.rb@@ -42,7 +42,8 @@ describe Notifications::MailService, 'Mentioned integration', type: :model donotification_settings: [build(:notification_setting,mentioned: true,- involved: true)+ assignee: true,+ responsible: true)],member_in_project: project,member_through_role: role@@ -62,7 +63,12 @@ describe Notifications::MailService, 'Mentioned integration', type: :model doenddef expect_no_assigned_notification- expect(Notification.where(recipient:, resource: work_package, reason: :involved))+ expect(Notification.where(recipient:, resource: work_package, reason: :assignee))+ .to be_empty+ end++ def expect_no_responsible_notification+ expect(Notification.where(recipient:, resource: work_package, reason: :responsible)).to be_emptyend@@ -94,9 +100,10 @@ describe Notifications::MailService, 'Mentioned integration', type: :model do.to have_received(:mentioned).once- # No involved notification since the assignee is also mentioned which trumps+ # No assignee and responsible notification since the assignee is also mentioned which trumps# being assignee and a user will only get one notification for a journal.expect_no_assigned_notification+ expect_no_responsible_notificationexpect_mentioned_notificationupdate_assignee!(assignee)diff --git a/spec/services/notifications/mentioned_journals_shared.rb b/spec/services/notifications/mentioned_journals_shared.rbindex 86f19c18a7d..9d83de4cfe2 100644--- a/spec/services/notifications/mentioned_journals_shared.rb+++ b/spec/services/notifications/mentioned_journals_shared.rb@@ -52,7 +52,8 @@ shared_context 'with a mentioned work package being updated again' donotification_settings: [build(:notification_setting,mentioned: true,- involved: true)+ assignee: true,+ responsible: true)],member_in_project: project,member_through_role: rolediff --git a/spec/services/user_preferences/update_service_integration_spec.rb b/spec/services/user_preferences/update_service_integration_spec.rbindex de5c56847e3..4519acbd4f9 100644--- a/spec/services/user_preferences/update_service_integration_spec.rb+++ b/spec/services/user_preferences/update_service_integration_spec.rb@@ -60,7 +60,8 @@ describe UserPreferences::UpdateService, 'integration', type: :model do{project_id: nil,watched: false,- involved: true,+ assignee: true,+ responsible: true,work_package_commented: false,work_package_created: true,work_package_processed: true,@@ -76,7 +77,8 @@ describe UserPreferences::UpdateService, 'integration', type: :model doexpect(default_ian.watched).to be trueexpect(default_ian.mentioned).to be true- expect(default_ian.involved).to be true+ expect(default_ian.assignee).to be true+ expect(default_ian.responsible).to be trueexpect(default_ian.work_package_commented).to be trueexpect(default_ian.work_package_created).to be trueexpect(default_ian.work_package_processed).to be true@@ -87,7 +89,8 @@ describe UserPreferences::UpdateService, 'integration', type: :model doexpect(subject.first.project_id).to be_nilexpect(subject.first.mentioned).to be falseexpect(subject.first.watched).to be false- expect(subject.first.involved).to be true+ expect(default_ian.assignee).to be true+ expect(default_ian.responsible).to be trueexpect(subject.first.work_package_commented).to be falseexpect(subject.first.work_package_created).to be trueexpect(subject.first.work_package_processed).to be truediff --git a/spec/support/pages/notifications/settings.rb b/spec/support/pages/notifications/settings.rbindex cb2d988e2d3..42ed49164dc 100644--- a/spec/support/pages/notifications/settings.rb+++ b/spec/support/pages/notifications/settings.rb@@ -53,7 +53,8 @@ module Pagesdef expect_global_represented(setting)%i[- involved+ assignee+ responsiblework_package_commentedwork_package_createdwork_package_processeddiff --git a/spec/workers/mails/shared/watcher_job.rb b/spec/workers/mails/shared/watcher_job.rbindex 3e025cdcd8a..d75809fa5ce 100644--- a/spec/workers/mails/shared/watcher_job.rb+++ b/spec/workers/mails/shared/watcher_job.rb@@ -126,25 +126,25 @@ shared_examples "watcher job" do |action|it_behaves_like 'notifies the watcher' dolet(:notification_settings) do- [build_stubbed(:notification_setting, mentioned: false, involved: false, watched: true)]+ [build_stubbed(:notification_setting, mentioned: false, assignee: false, responsible: false, watched: true)]endendit_behaves_like 'notifies the watcher' dolet(:notification_settings) do- [build_stubbed(:notification_setting, mentioned: false, involved: false, watched: true)]+ [build_stubbed(:notification_setting, mentioned: false, assignee: false, responsible: false, watched: true)]endendit_behaves_like 'does not notify the watcher' dolet(:notification_settings) do- [build_stubbed(:notification_setting, mentioned: false, involved: true, watched: false)]+ [build_stubbed(:notification_setting, mentioned: false, assignee: true, responsible: true, watched: false)]endendit_behaves_like 'does not notify the watcher' dolet(:notification_settings) do- [build_stubbed(:notification_setting, mentioned: true, involved: false, watched: false)]+ [build_stubbed(:notification_setting, mentioned: true, assignee: false, responsible: false, watched: false)]endend