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
adapt active job specs
ulferts9911932e5168
diff --git a/modules/meeting/app/models/journal/meeting_agenda_item_journal.rb b/modules/meeting/app/models/journal/meeting_agenda_item_journal.rbindex 155c6178231..0a36e33a60b 100644--- a/modules/meeting/app/models/journal/meeting_agenda_item_journal.rb+++ b/modules/meeting/app/models/journal/meeting_agenda_item_journal.rb@@ -1,4 +1,5 @@# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbHdiff --git a/modules/meeting/app/models/meeting_agenda_item.rb b/modules/meeting/app/models/meeting_agenda_item.rbindex e51d4fc1eb8..0299b0819c1 100644--- a/modules/meeting/app/models/meeting_agenda_item.rb+++ b/modules/meeting/app/models/meeting_agenda_item.rb@@ -1,4 +1,5 @@# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbHdiff --git a/modules/meeting/spec/services/recurring_meetings/update_service_integration_spec.rb b/modules/meeting/spec/services/recurring_meetings/update_service_integration_spec.rbindex 8e3656fe8d0..de162fff13d 100644--- a/modules/meeting/spec/services/recurring_meetings/update_service_integration_spec.rb+++ b/modules/meeting/spec/services/recurring_meetings/update_service_integration_spec.rb@@ -1,4 +1,5 @@# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbH@@ -97,13 +98,13 @@ RSpec.describe RecurringMeetings::UpdateService, "integration", type: :model doendend- context "when updating the frequency and start_time" do+ context "when updating the frequency and start_time",+ with_good_job: RecurringMeetings::InitNextOccurrenceJob dolet(:params) do{ start_time: Time.zone.today + 2.days + 11.hours }endbefore do- ActiveJob::Base.disable_test_adapterRecurringMeetings::InitNextOccurrenceJob.set(wait_until: Time.zone.today + 1.day + 10.hours).perform_later(series)diff --git a/modules/storages/spec/workers/storages/copy_project_folders_job_spec.rb b/modules/storages/spec/workers/storages/copy_project_folders_job_spec.rbindex 73684682c11..231e68702c5 100644--- a/modules/storages/spec/workers/storages/copy_project_folders_job_spec.rb+++ b/modules/storages/spec/workers/storages/copy_project_folders_job_spec.rb@@ -31,7 +31,7 @@require "spec_helper"require_module_spec_helper-RSpec.describe Storages::CopyProjectFoldersJob, :job, :webmock, with_good_job_batches: [Storages::CopyProjectFoldersJob] do+RSpec.describe Storages::CopyProjectFoldersJob, :job, :webmock, with_good_job: Storages::CopyProjectFoldersJob doinclude ActiveJob::TestHelperlet(:storage) { create(:nextcloud_storage, :as_automatically_managed) }@@ -227,7 +227,10 @@ RSpec.describe Storages::CopyProjectFoldersJob, :job, :webmock, with_good_job_badescribed_class.perform_later(source:, target:, work_packages_map:)endGoodJob.perform_inline- job = GoodJob::Job.order(:created_at).last+ job = GoodJob::Job+ .where(job_class: "Storages::CopyProjectFoldersJob")+ .order(:created_at)+ .lastexpect(job.executions_count).to eq(3)expect(job.serialized_params["exception_executions"]["[Storages::Errors::PollingRequired]"]).to eq(2)diff --git a/modules/storages/spec/workers/storages/manage_storage_integrations_job_spec.rb b/modules/storages/spec/workers/storages/manage_storage_integrations_job_spec.rbindex 663f9b022ee..6a2d1ef96a4 100644--- a/modules/storages/spec/workers/storages/manage_storage_integrations_job_spec.rb+++ b/modules/storages/spec/workers/storages/manage_storage_integrations_job_spec.rb@@ -33,9 +33,8 @@ require_module_spec_helperRSpec.describe Storages::ManageStorageIntegrationsJob, type: :job dodescribe ".debounce" do- context "when has been debounced by other thread" do- before { ActiveJob::Base.disable_test_adapter }-+ context "when has been debounced by other thread",+ with_good_job_batches: [described_class] doit "does not change the number of enqueued jobs" doexpect(GoodJob::Job.count).to eq(0)expect(described_class.perform_later.successfully_enqueued?).to be(true)diff --git a/spec/workers/notifications/schedule_date_alerts_notifications_job_spec.rb b/spec/workers/notifications/schedule_date_alerts_notifications_job_spec.rbindex d179de7bd9c..ddcc2b19186 100644--- a/spec/workers/notifications/schedule_date_alerts_notifications_job_spec.rb+++ b/spec/workers/notifications/schedule_date_alerts_notifications_job_spec.rb@@ -28,7 +28,10 @@require "spec_helper"-RSpec.describe Notifications::ScheduleDateAlertsNotificationsJob, type: :job, with_ee: %i[date_alerts] do+RSpec.describe Notifications::ScheduleDateAlertsNotificationsJob,+ type: :job,+ with_ee: %i[date_alerts],+ with_good_job_batches: [Notifications::CreateDateAlertsNotificationsJob] doshared_let(:project) { create(:project, name: "main") }# Paris and Berlin are both UTC+01:00 (CET) or UTC+02:00 (CEST)shared_let(:timezone_paris) { ActiveSupport::TimeZone["Europe/Paris"] }@@ -52,10 +55,6 @@ RSpec.describe Notifications::ScheduleDateAlertsNotificationsJob, type: :job, wiendend- before do- ActiveJob::Base.disable_test_adapter- end-def set_predecessor_cron_time(cron_at)GoodJob::Job.where(id: scheduled_predecessor_job.job_id)diff --git a/spec/workers/notifications/schedule_reminder_mails_job_spec.rb b/spec/workers/notifications/schedule_reminder_mails_job_spec.rbindex 38c8d1c1ff7..14ffa6f1a83 100644--- a/spec/workers/notifications/schedule_reminder_mails_job_spec.rb+++ b/spec/workers/notifications/schedule_reminder_mails_job_spec.rb@@ -28,7 +28,10 @@require "spec_helper"-RSpec.describe Notifications::ScheduleReminderMailsJob, type: :job do+RSpec.describe Notifications::ScheduleReminderMailsJob,+ type: :job,+ with_good_job_batches: [Mails::ReminderJob,+ Notifications::ScheduleReminderMailsJob] dolet(:scheduled_job) dodescribed_class.perform_later.tap do |job|set_cron_time(job, job_cron_at)@@ -47,9 +50,6 @@ RSpec.describe Notifications::ScheduleReminderMailsJob, type: :job dolet(:ids) { [23, 42] }before do- # We need to access the job as stored in the database to get at the scheduled_at time persisted there- ActiveJob::Base.disable_test_adapter-scope = instance_double(ActiveRecord::Relation)allow(User).to receive(:having_reminder_mail_to_send).and_return(scope)allow(scope).to receive(:pluck).with(:id).and_return(ids)