rails/rails — pull request #6946 by threedaymonk (2012-07-03 15:35:31+00:00)
Title: Ensure that queued jobs are marshallable

By marshalling and unmarshalling jobs when adding them to the test queue, we can ensure that jobs created during test runs are valid candidates for marshalling, and, thus, that they can be used with queueing backends other than the default simple in-process implementation.

As Rails::Queueing::Queue (and TestQueue) are not marshallable, this ensures that a queued job does not contain a reference to the queue itself.

This establishes marshallability and a constrained object graph as a standard expectation for jobs, which is, I think, a reasonable expectation. Where an application explicitly does not care about this, authors are free to configure a different test queue implementation in the application's test environment.