]> git.openstreetmap.org Git - rails.git/blobdiff - test/jobs/trace_importer_job_test.rb
Merge remote-tracking branch 'upstream/pull/3378'
[rails.git] / test / jobs / trace_importer_job_test.rb
index bf30e69414d30d298127b91ff76d5d3b783ce04d..e1ddcc9679cbd1161a366bffd20c6fdc6fbc4cb8 100644 (file)
@@ -12,13 +12,9 @@ class TraceImporterJobTest < ActiveJob::TestCase
     end
 
     trace.stub(:import, gpx) do
     end
 
     trace.stub(:import, gpx) do
-      perform_enqueued_jobs do
-        TraceImporterJob.perform_now(trace)
-      end
+      TraceImporterJob.perform_now(trace)
     end
 
     end
 
-    assert_performed_jobs 1
-
     email = ActionMailer::Base.deliveries.last
     assert_equal trace.user.email, email.to[0]
     assert_match(/success/, email.subject)
     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
     end
 
     trace.stub(:import, gpx) do
-      perform_enqueued_jobs do
-        TraceImporterJob.perform_now(trace)
-      end
+      TraceImporterJob.perform_now(trace)
     end
 
     end
 
-    assert_performed_jobs 1
-
     email = ActionMailer::Base.deliveries.last
     assert_equal trace.user.email, email.to[0]
     assert_match(/failure/, email.subject)
     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
     # 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
 
     end
 
-    assert_performed_jobs 1
-
     email = ActionMailer::Base.deliveries.last
     assert_equal trace.user.email, email.to[0]
     assert_match(/failure/, email.subject)
     email = ActionMailer::Base.deliveries.last
     assert_equal trace.user.email, email.to[0]
     assert_match(/failure/, email.subject)