From 53235ee4f43f080938afe167869b4996554965e1 Mon Sep 17 00:00:00 2001 From: Yuri Sidorov <403994+newstler@users.noreply.github.com> Date: Tue, 18 Apr 2023 18:51:25 +0200 Subject: [PATCH] Fix: uninitialized constant FactoryBot::Syntax on Heroku (#722) --- Gemfile | 6 +++--- Gemfile.lock | 2 +- config/initializers/factory_girl.rb | 7 ------- test/test_helper.rb | 4 ++++ 4 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 config/initializers/factory_girl.rb diff --git a/Gemfile b/Gemfile index 9c33b1074..d701800cf 100644 --- a/Gemfile +++ b/Gemfile @@ -64,6 +64,9 @@ group :development, :test do # A gem for generating test coverage results in your browser. gem "simplecov", require: false + + # Generate test objects. + gem "factory_bot_rails" end group :development do @@ -140,9 +143,6 @@ group :test do # Interact with emails during testing. gem "capybara-email" - # Generate test objects. - gem "factory_bot_rails", group: :development - # Write system tests by pointing and clicking in your browser. gem "magic_test" diff --git a/Gemfile.lock b/Gemfile.lock index 47dff9201..9a94b6a11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -656,4 +656,4 @@ RUBY VERSION ruby 3.2.1p31 BUNDLED WITH - 2.4.8 + 2.4.10 diff --git a/config/initializers/factory_girl.rb b/config/initializers/factory_girl.rb deleted file mode 100644 index 8e4775c17..000000000 --- a/config/initializers/factory_girl.rb +++ /dev/null @@ -1,7 +0,0 @@ -if defined?(FactoryBot) - - class ActiveSupport::TestCase - include FactoryBot::Syntax::Methods - end - -end diff --git a/test/test_helper.rb b/test/test_helper.rb index fd4282cb4..ba7a56341 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -27,3 +27,7 @@ # Add more helper methods to be used by all tests here... end + +class ActiveSupport::TestCase + include FactoryBot::Syntax::Methods +end