diff --git a/test/generators/suspenders/factories_generator_test.rb b/test/generators/suspenders/factories_generator_test.rb index 779b3513e..cad2fb70c 100644 --- a/test/generators/suspenders/factories_generator_test.rb +++ b/test/generators/suspenders/factories_generator_test.rb @@ -175,6 +175,20 @@ class FactoriesGenerator::RSpecTest < Rails::Generators::TestCase end end + test "does not modify rails_helper if it's configured to include support files" do + touch("spec/rails_helper.rb") + rails_helper = <<~RUBY + Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |file| require file } + RUBY + File.open(app_root("spec/rails_helper.rb"), "w") { _1.write rails_helper } + + run_generator + + assert_file app_root("spec/rails_helper.rb") do |file| + assert_equal rails_helper, file + end + end + test "creates linting test" do factories_spec = <<~RUBY require "rails_helper"