The Delayed::Job constant is defined dynamically when the delayed job backend is setup by Delayed::Worker.guess_backend (it selects ActiveRecord as your backend if ActiveRecord is defined) or by Delayed::Worker.backend = [back end].
The rspec tests use the latter method to setup the back end while the initialization defined by the Delayed::Railtie does the former for you when rails is initialized.
So, you need to run your code in the context of rails or manually do the setup yourself. Try: