diff options
Diffstat (limited to 'activejob/test/cases')
-rw-r--r-- | activejob/test/cases/job_serialization_test.rb | 11 | ||||
-rw-r--r-- | activejob/test/cases/logging_test.rb | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/activejob/test/cases/job_serialization_test.rb b/activejob/test/cases/job_serialization_test.rb index 86f3651564..c1cec1f1d6 100644 --- a/activejob/test/cases/job_serialization_test.rb +++ b/activejob/test/cases/job_serialization_test.rb @@ -61,4 +61,15 @@ class JobSerializationTest < ActiveSupport::TestCase assert_equal "Hawaii", job.serialize["timezone"] end end + + test "serialize stores the enqueued_at time" do + h1 = HelloJob.new + type = h1.serialize["enqueued_at"].class + assert_equal String, type + + h2 = HelloJob.deserialize(h1.serialize) + # We should be able to parse a timestamp + type = Time.parse(h2.enqueued_at).class + assert_equal Time, type + end end diff --git a/activejob/test/cases/logging_test.rb b/activejob/test/cases/logging_test.rb index 6154ba301d..acd37456c9 100644 --- a/activejob/test/cases/logging_test.rb +++ b/activejob/test/cases/logging_test.rb @@ -115,6 +115,8 @@ class LoggingTest < ActiveSupport::TestCase perform_enqueued_jobs do LoggingJob.perform_later "Dummy" assert_match(/Performing LoggingJob \(Job ID: .*?\) from .*? with arguments:.*Dummy/, @logger.messages) + + assert_match(/enqueued at /, @logger.messages) assert_match(/Dummy, here is it: Dummy/, @logger.messages) assert_match(/Performed LoggingJob \(Job ID: .*?\) from .*? in .*ms/, @logger.messages) end |