diff --git a/config/application.rb b/config/application.rb
index <HASH>..<HASH> 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -4,10 +4,10 @@ require 'rails/all'
 
 Bundler.require(:default, Rails.env)
 
-Dotenv.overload File.expand_path('../../spec/env.test', __FILE__) if Rails.env.test?
-
 module Huginn
   class Application < Rails::Application
+    Dotenv.overload File.expand_path('../../spec/env.test', __FILE__) if Rails.env.test?
+
     # Settings in config/environments/* take precedence over those specified here.
     # Application configuration should go into files in config/initializers
     # -- all .rb files in that directory are automatically loaded.
Call `Dotenv.overload` after `Dotenv::Railtie.load` is called

`dotenv-rails` calls `Dotenv::Railtie.load` when `Huginn::Application`
is defined, so the `Dotenv.overload` call should be moved here.