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
unsubscribe from OP notification to avoid affecting other specs
ulfertsa78b59d4792c
diff --git a/spec/models/work_package/openproject_notifications_spec.rb b/spec/models/work_package/openproject_notifications_spec.rbindex 0a1f7779806..e7b0940308b 100644--- a/spec/models/work_package/openproject_notifications_spec.rb+++ b/spec/models/work_package/openproject_notifications_spec.rb@@ -45,19 +45,23 @@ describe WorkPackage, type: :model dolet(:journal_ids) { [] }- before do+ let!(:subscription) doOpenProject::Notifications.subscribe(OpenProject::Events::AGGREGATED_WORK_PACKAGE_JOURNAL_READY) do |payload|journal_ids << payload[:journal_id]endend+ after do+ OpenProject::Notifications.unsubscribe(OpenProject::Events::AGGREGATED_WORK_PACKAGE_JOURNAL_READY, subscription)+ end+context 'after creation' dobefore dowork_packageendit "are triggered" do- expect(journal_ids).to include (work_package.journals.last.id)+ expect(journal_ids).to include(work_package.journals.last.id)endend@@ -71,7 +75,7 @@ describe WorkPackage, type: :model doendit "are triggered" do- expect(journal_ids).to include (work_package.journals.last.id)+ expect(journal_ids).to include(work_package.journals.last.id)endendend