X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/db1094c1145754f0ba9ac982aa0920f0f6760b54..6ce9ec0a1c3afe348997e4f70c17e67dfc4fd346:/test/jobs/trace_importer_job_test.rb diff --git a/test/jobs/trace_importer_job_test.rb b/test/jobs/trace_importer_job_test.rb index bf30e6941..e1ddcc967 100644 --- a/test/jobs/trace_importer_job_test.rb +++ b/test/jobs/trace_importer_job_test.rb @@ -12,13 +12,9 @@ class TraceImporterJobTest < ActiveJob::TestCase end trace.stub(:import, gpx) do - perform_enqueued_jobs do - TraceImporterJob.perform_now(trace) - end + TraceImporterJob.perform_now(trace) end - assert_performed_jobs 1 - email = ActionMailer::Base.deliveries.last assert_equal trace.user.email, email.to[0] assert_match(/success/, email.subject) @@ -36,13 +32,9 @@ class TraceImporterJobTest < ActiveJob::TestCase end trace.stub(:import, gpx) do - perform_enqueued_jobs do - TraceImporterJob.perform_now(trace) - end + TraceImporterJob.perform_now(trace) end - assert_performed_jobs 1 - email = ActionMailer::Base.deliveries.last assert_equal trace.user.email, email.to[0] assert_match(/failure/, email.subject) @@ -54,13 +46,9 @@ class TraceImporterJobTest < ActiveJob::TestCase # Check that the user gets a failure notification when something goes badly wrong trace = create(:trace) trace.stub(:import, -> { raise }) do - perform_enqueued_jobs do - TraceImporterJob.perform_now(trace) - end + TraceImporterJob.perform_now(trace) end - assert_performed_jobs 1 - email = ActionMailer::Base.deliveries.last assert_equal trace.user.email, email.to[0] assert_match(/failure/, email.subject)