<commit_before>ENV['RAILS_ENV'] ||= 'test'

require File.expand_path('../../config/environment', __FILE__)
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
require 'capybara-screenshot/rspec'
require 'capybara/poltergeist'
require 'database_cleaner'

require 'simplecov'
SimpleCov.start do
  add_group "app", "app"
end

Capybara.app_host = "http://localhost:3001"
Capybara.server_host = "localhost"
Capybara.server_port = "3001"

RSpec.configure do |config|
  config.include Capybara::DSL
  config.include FactoryGirl::Syntax::Methods
  
  config.before(:suite) do
    DatabaseCleaner[:active_record,{connection: :test}].strategy = :deletion
    DatabaseCleaner[:active_record,{connection: :test}].start
    DatabaseCleaner[:active_record,{connection: :test}].clean

    load Rails.root + "db/seeds.rb"<commit_msg>Tests: changing database cleaner strategy<commit_after>ENV['RAILS_ENV'] ||= 'test'

require File.expand_path('../../config/environment', __FILE__)
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
require 'capybara-screenshot/rspec'
require 'capybara/poltergeist'
require 'database_cleaner'

require 'simplecov'
SimpleCov.start do
  add_group "app", "app"
end

Capybara.app_host = "http://localhost:3001"
Capybara.server_host = "localhost"
Capybara.server_port = "3001"

RSpec.configure do |config|
  config.include Capybara::DSL
  config.include FactoryGirl::Syntax::Methods
  
  config.before(:suite) do
    DatabaseCleaner.strategy = :truncation
    DatabaseCleaner.start
    DatabaseCleaner.clean

    load Rails.root + "db/seeds.rb"
{'fraction_non_alphanumeric': 0.1447520184544406, 'fraction_numerical': 0.00922722029988466, 'mean_word_length': 5.571969696969697, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1262072', 'n_tokens_mistral': 622, 'n_tokens_neox': 597, 'n_words': 108}