aboutsummaryrefslogtreecommitdiffstats
path: root/activejob
diff options
context:
space:
mode:
Diffstat (limited to 'activejob')
-rw-r--r--activejob/CHANGELOG.md2
-rw-r--r--activejob/lib/active_job/logging.rb2
-rw-r--r--activejob/test/cases/test_helper_test.rb6
3 files changed, 8 insertions, 2 deletions
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md
index b64cd04dca..79235019fe 100644
--- a/activejob/CHANGELOG.md
+++ b/activejob/CHANGELOG.md
@@ -1,5 +1,5 @@
* Fixed serializing `:at` option for `assert_enqueued_with`
- and `assert_performed_with`
+ and `assert_performed_with`.
*Wojciech Wnętrzak*
diff --git a/activejob/lib/active_job/logging.rb b/activejob/lib/active_job/logging.rb
index d72e1bdfce..605057d1e8 100644
--- a/activejob/lib/active_job/logging.rb
+++ b/activejob/lib/active_job/logging.rb
@@ -26,7 +26,7 @@ module ActiveJob
end
end
- before_enqueue do |job|
+ after_enqueue do |job|
if job.scheduled_at
ActiveSupport::Notifications.instrument "enqueue_at.active_job",
adapter: job.class.queue_adapter, job: job
diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb
index 87dfca4851..a66f5d762c 100644
--- a/activejob/test/cases/test_helper_test.rb
+++ b/activejob/test/cases/test_helper_test.rb
@@ -461,6 +461,12 @@ class PerformedJobsTest < ActiveJob::TestCase
assert_performed_with(job: HelloJob, at: Date.tomorrow.noon) do
HelloJob.set(wait_until: Date.tomorrow.noon).perform_later
end
+
+ assert_raise ActiveSupport::TestCase::Assertion do
+ assert_performed_with(job: HelloJob, at: Date.today.noon) do
+ HelloJob.set(wait_until: Date.tomorrow.noon).perform_later
+ end
+ end
end
def test_assert_performed_job_with_global_id_args