diff --git a/spec/support/acceptance/helpers/step_helpers.rb b/spec/support/acceptance/helpers/step_helpers.rb index 530133fc5..55c03246e 100644 --- a/spec/support/acceptance/helpers/step_helpers.rb +++ b/spec/support/acceptance/helpers/step_helpers.rb @@ -88,10 +88,10 @@ def create_rails_application end def rails_new_command - if rails_version =~ '~> 6.0' - "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --skip-javascript --no-rc" + if rails_version >= 6.0 + "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --skip-javascript --no-rc --skip-bootsnap" else - "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --no-rc" + "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --no-rc --skip-bootsnap" end end diff --git a/spec/support/unit/rails_application.rb b/spec/support/unit/rails_application.rb index fdcdb32b5..7af743cbe 100644 --- a/spec/support/unit/rails_application.rb +++ b/spec/support/unit/rails_application.rb @@ -77,7 +77,6 @@ def temp_view_path_for(path) def generate rails_new fix_available_locales_warning - remove_bootsnap write_database_configuration write_activerecord_model_with_default_connection write_activerecord_model_with_different_connection @@ -90,25 +89,10 @@ def rails_new end def rails_new_command - if rails_version > 5 - [ - 'rails', - 'new', - fs.project_directory.to_s, - "--database=#{database.adapter_name}", - '--skip-bundle', - '--no-rc', - '--skip-webpack-install', - ] + if rails_version >= 6.0 + "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --skip-javascript --no-rc --skip-bootsnap" else - [ - 'rails', - 'new', - fs.project_directory.to_s, - "--database=#{database.adapter_name}", - '--skip-bundle', - '--no-rc', - ] + "bundle exec rails new #{fs.project_directory} --database=#{database.adapter_name} --skip-bundle --no-rc --skip-bootsnap" end end @@ -124,16 +108,6 @@ def fix_available_locales_warning end end - def remove_bootsnap - # Rails 5.2 introduced bootsnap, which is helpful when you're developing - # or deploying an app, but we don't really need it (and it messes with - # Zeus anyhow) - fs.comment_lines_matching( - 'config/boot.rb', - %r{\Arequire 'bootsnap/setup'}, - ) - end - def write_database_configuration YAML.dump(database.config.load_file, fs.open('config/database.yml', 'w')) end