The development env is loaded before the test env when running unit test

HI all,

When I print Rails.env in one of my initializer, I noticed that the dev env is loaded first before the test env. There are some bits that I don’t want to run for unit testing (i.e background job). Is there any way to setup Rails not to run the development env when unit test is ran?

Thanks heaps in advance for your help.

Kind regards,

unless Rails.env == 'test'
  # skip these bits