<commit_before>require_relative '../../lib/sm'
require 'factory_girl'
require 'faker'

require 'lanes/db'
Lanes::DB.establish_connection

TEST_TENANT = SM::Tenant.find_or_create_by(slug: 'test', name: 'testing tenant', email: '<EMAIL>')
MultiTenant.with(TEST_TENANT) do
    require 'lanes/spec_helper'
end
require 'database_cleaner'
require "shrine/storage/memory"
require 'vcr'

VCR.configure do |config|
  config.cassette_library_dir = "fixtures/vcr_cassettes"
  config.hook_into :webmock
end


Shrine.storages = {
  cache: Shrine::Storage::Memory.new,
  store: Shrine::Storage::Memory.new,
}

module PaymentHelpers
    def with_payment_proccessor

        allow(SM::BraintreeConfig).to receive(:system_settings_values) {
            { 'merchant_id' => 'dshtky2jcjpr96z3',
              'public_key'  => '<KEY>',
              'private_key' => '<KEY>' }
        }
        yield
    end
end


# Configure RSpec to your liking
RSpec.configure do |config|

    config.include PaymentHelpers
    config.around(:each) do |example|
        MultiTenant.with(TEST_TENANT) do
            example.run
        end<commit_msg>remove duplicated setup code that's also in lanes/spec_helper<commit_after>require_relative '../../lib/sm'
require 'factory_girl'
require 'faker'

require 'lanes/db'
Lanes::DB.establish_connection

TEST_TENANT = SM::Tenant.find_or_create_by(slug: 'test', name: 'testing tenant', email: '<EMAIL>')
MultiTenant.with(TEST_TENANT) do
    require 'lanes/spec_helper'
end


module PaymentHelpers
    def with_payment_proccessor

        allow(SM::BraintreeConfig).to receive(:system_settings_values) {
            { 'merchant_id' => 'dshtky2jcjpr96z3',
              'public_key'  => '<KEY>',
              'private_key' => '<KEY>' }
        }
        yield
    end
end


# Configure RSpec to your liking
RSpec.configure do |config|

    config.include PaymentHelpers
    config.around(:each) do |example|
        MultiTenant.with(TEST_TENANT) do
            example.run
        end
{'fraction_non_alphanumeric': 0.11746987951807229, 'fraction_numerical': 0.004016064257028112, 'mean_word_length': 3.3995584988962473, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '7190537', 'n_tokens_mistral': 677, 'n_tokens_neox': 664, 'n_words': 133}