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

get the job class name from the class instead of string literal in two places

Ivan Kuchine7b8837ccad5
diff --git a/spec/workers/notifications/schedule_date_alerts_notifications_job_spec.rb b/spec/workers/notifications/schedule_date_alerts_notifications_job_spec.rb
index 6475236eb04..5e9fcc86917 100644
--- a/spec/workers/notifications/schedule_date_alerts_notifications_job_spec.rb
+++ b/spec/workers/notifications/schedule_date_alerts_notifications_job_spec.rb
@@ -92,15 +92,17 @@ RSpec.describe Notifications::ScheduleDateAlertsNotificationsJob, type: :job, wi
end
shared_examples_for "job execution creates date alerts creation job" do
+ let(:job_class) { Notifications::CreateDateAlertsNotificationsJob.name }
+
it "creates the job for the user" do
expect do
run_job(timezone:, scheduled_at:, local_time:) do
- j = GoodJob::Job.where(job_class: "Notifications::CreateDateAlertsNotificationsJob")
+ j = GoodJob::Job.where(job_class:)
.order(created_at: :desc)
.last
expect_job(j, user)
end
- end.to change { GoodJob::Job.where(job_class: "Notifications::CreateDateAlertsNotificationsJob").count }.by 1
+ end.to change { GoodJob::Job.where(job_class:).count }.by 1
end
end