Improved tests for tests middleware.
Added: tests for jobs middleware.