<commit_before># encoding: UTF-8

require File.expand_path('../../test_helper', __FILE__)

require 'sinatra/base'

describe "Features" do
  include RackTestMethods

  before do
    @site = setup_site
  end

  after do
    teardown_site
  end

  def app
    Spontaneous::Rack.application
  end

  def api_key
    @key
  end

  describe "Feature" do
    before do
      Content.delete
      Spontaneous::Permissions::User.delete


      config = mock()
      config.stubs(:reload_classes).returns(false)
      config.stubs(:auto_login).returns('root')
      config.stubs(:default_charset).returns('utf-8')
      config.stubs(:publishing_method).returns(:immediate)
      config.stubs(:site_domain).returns('example.org')
      config.stubs(:site_id).returns('example_org')
      @site.stubs(:config).returns(config)

      @user = Spontaneous::Permissions::User.create(:email => "<EMAIL>", :login => "root", :name => "root", :password => "<PASSWORD>")
      @user.update(:level => Spontaneous::Permissions.root)
      @user.save<commit_msg>Mock out the the simultaneous connection config<commit_after># encoding: UTF-8

require File.expand_path('../../test_helper', __FILE__)

require 'sinatra/base'

describe "Features" do
  include RackTestMethods

  before do
    @site = setup_site
  end

  after do
    teardown_site
  end

  def app
    Spontaneous::Rack.application
  end

  def api_key
    @key
  end

  describe "Feature" do
    before do
      Content.delete
      Spontaneous::Permissions::User.delete


      config = mock()
      config.stubs(:reload_classes).returns(false)
      config.stubs(:auto_login).returns('root')
      config.stubs(:default_charset).returns('utf-8')
      config.stubs(:publishing_method).returns(:immediate)
      config.stubs(:simultaneous_connection).returns("")
      config.stubs(:site_domain).returns('example.org')
      config.stubs(:site_id).returns('example_org')
      @site.stubs(:config).returns(config)

      @user = Spontaneous::Permissions::User.create(:email => "<EMAIL>", :login => "root", :name => "root", :password => "<PASSWORD>")
      @user.update(:level => Spontaneous::Permissions.root)
      @user.save
{'fraction_non_alphanumeric': 0.14167051222888785, 'fraction_numerical': 0.0018458698661744347, 'mean_word_length': 3.6324786324786325, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '2251752', 'n_tokens_mistral': 688, 'n_tokens_neox': 672, 'n_words': 122}