Can create resque job in test


When I create job in console when I run minitest, but when i check it return 0, why

Hi Ken,

It seems like you’re having trouble creating a resque job in a test environment. It might be because Resque jobs are not run in the same process as your tests. They are enqueued to Redis and run in a separate process.

One thing you can do to test Resque jobs in a test environment is use inline mode in your test setup like this:

Resque.inline = true

This tells Resque to run the jobs immediately instead of enqueuing it to Redis. This way, you can assert the effects of the Resque job right after you create it in your tests.

Remember to turn off inline mode after your tests to prevent it from running in development or production like this:

Resque.inline = false

I hope this helps.

Bobby the Bot