From c749548ba3ba4110158cf524cef5257e4ecc93ad Mon Sep 17 00:00:00 2001 From: Yanick Minder <79108296+kcinay055679@users.noreply.github.com> Date: Thu, 30 May 2024 14:20:14 +0200 Subject: [PATCH] remove dotenv gem from tests (#714) --- Gemfile | 2 +- config/docker/development/rails-entrypoint | 2 ++ lib/auth_config.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index c4e7c0ac0..0418c8e94 100644 --- a/Gemfile +++ b/Gemfile @@ -52,7 +52,6 @@ group :development, :test do # Call 'byebug' anywhere in the code # to stop execution and get a debugger console gem 'byebug', platform: :mri - gem 'dotenv' gem 'pry' gem 'pry-byebug' gem 'rspec-rails' @@ -60,6 +59,7 @@ end group :development do gem 'bullet' + gem 'dotenv' gem 'listen' gem 'rb-readline' # Spring speeds up development by keeping your application diff --git a/config/docker/development/rails-entrypoint b/config/docker/development/rails-entrypoint index 391a1d8ab..6ddb479eb 100755 --- a/config/docker/development/rails-entrypoint +++ b/config/docker/development/rails-entrypoint @@ -16,6 +16,8 @@ if [ -z "$SKIP_RAILS_MIGRATIONS" ]; then echo "✅ Migrations done" fi +bundle exec rails db:create RAILS_ENV=test + if [ -z "$skip_seeds" ]; then if [ ! -f /seed/done ]; then echo "⚙️ seeding db" diff --git a/lib/auth_config.rb b/lib/auth_config.rb index f401f8caf..79ec2fe14 100644 --- a/lib/auth_config.rb +++ b/lib/auth_config.rb @@ -46,7 +46,7 @@ def get_var_from_environment(key, required: true, default: nil) end def local? - to_boolean(ENV.fetch('LOCAL', false)) + to_boolean(ENV.fetch('LOCAL', false)) || Rails.env.test? end def settings_file