<commit_before>begin
  require 'spork'
rescue LoadError => e
end

def configure
  # Configure Rails Environment
  ENV["RAILS_ENV"] = "test"

  require File.expand_path("../dummy/config/environment.rb", __FILE__)

  require 'authlogic/test_case'
  include Authlogic::TestCase

  require "rails/test_help"
  require "rspec/rails"
  require 'factory_girl'
  require 'factories.rb'

  ActionMailer::Base.delivery_method = :test
  ActionMailer::Base.perform_deliveries = true
  ActionMailer::Base.default_url_options[:host] = "test.com"

  Rails.backtrace_cleaner.remove_silencers!
  # Disable rails loggin for faster IO. Remove this if you want to have a test.log
  Rails.logger.level = 4

  # Configure capybara for integration testing
  require "capybara/rails"
  require 'capybara/poltergeist'
  Capybara.default_driver = :rack_test
  Capybara.default_selector = :css
  Capybara.javascript_driver = :poltergeist
  # Raising the default wait time for capybara requests on ci under ruby 1.8.7
  Capybara.default_wait_time = 5 if ENV['CI'] && RUBY_VERSION == "1.8.7"
  Capybara.register_driver(:rack_test_translated_header) do |app|<commit_msg>Enabled poltergeist debugging on travis under ruby 1.8.7<commit_after>begin
  require 'spork'
rescue LoadError => e
end

def configure
  # Configure Rails Environment
  ENV["RAILS_ENV"] = "test"

  require File.expand_path("../dummy/config/environment.rb", __FILE__)

  require 'authlogic/test_case'
  include Authlogic::TestCase

  require "rails/test_help"
  require "rspec/rails"
  require 'factory_girl'
  require 'factories.rb'

  ActionMailer::Base.delivery_method = :test
  ActionMailer::Base.perform_deliveries = true
  ActionMailer::Base.default_url_options[:host] = "test.com"

  Rails.backtrace_cleaner.remove_silencers!
  # Disable rails loggin for faster IO. Remove this if you want to have a test.log
  Rails.logger.level = 4

  # Configure capybara for integration testing
  require "capybara/rails"
  require 'capybara/poltergeist'
  Capybara.default_driver = :rack_test
  Capybara.default_selector = :css
  Capybara.register_driver :poltergeist do |app|
    Capybara::Poltergeist::Driver.new(app, {
      :debug => ENV['CI'] && RUBY_VERSION == "1.8.7"
    })
  end
  Capybara.javascript_driver = :poltergeist
  # Raising the default wait time for capybara requests on ci under ruby 1.8.7
  Capybara.default_wait_time = 5 if ENV['CI'] && RUBY_VERSION == "1.8.7"
  Capybara.register_driver(:rack_test_translated_header) do |app|
{'fraction_non_alphanumeric': 0.10108739428111156, 'fraction_numerical': 0.008860249697946033, 'mean_word_length': 4.710344827586207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5282851', 'n_tokens_mistral': 889, 'n_tokens_neox': 837, 'n_words': 196}