<commit_before>require 'spec_helper'

class TestCheckpointV1 < CheckpointV1; end

describe "Bannings" do
  include Rack::Test::Methods

  def app
    TestCheckpointV1
  end

  let :realm do
    realm = Realm.create!(:label => "area51")
    Domain.create!(:realm => realm, :name => 'example.org')
    realm
  end

  let :other_realm do
    realm = Realm.create!(:label => "area52")
    Domain.create!(:realm => realm, :name => 'example.com')
    realm
  end

  let :someone do
    Identity.create!(:realm => realm)
  end

  let :somegod do
    Identity.create!(:god => true, :realm => realm)
  end

  let :false_god do
    Identity.create!(:god => true, :realm => Realm.create!(:label => 'hell'))
  end

  let :someone_session do
    Session.create!(:identity => someone).key
  end

  let :somegod_session do
    Session.create!(:identity => somegod).key
  end

  let :false_god_session do
    Session.create!(:identity => false_god).key
  end

  let :crook do
    result = Identity.new(:realm => realm)
    result.send(:fingerprints=, ['fingerprint1'])
    result.save!
    result
  end

  let(:checkpoint) {
    checkpoint = stub
    checkpoint.stub!(:service_url => 'http://example.com')
    checkpoint
  }

<commit_msg>Fix deprecated rspec syntax<commit_after>require 'spec_helper'

class TestCheckpointV1 < CheckpointV1; end

describe "Bannings" do
  include Rack::Test::Methods

  def app
    TestCheckpointV1
  end

  let :realm do
    realm = Realm.create!(:label => "area51")
    Domain.create!(:realm => realm, :name => 'example.org')
    realm
  end

  let :other_realm do
    realm = Realm.create!(:label => "area52")
    Domain.create!(:realm => realm, :name => 'example.com')
    realm
  end

  let :someone do
    Identity.create!(:realm => realm)
  end

  let :somegod do
    Identity.create!(:god => true, :realm => realm)
  end

  let :false_god do
    Identity.create!(:god => true, :realm => Realm.create!(:label => 'hell'))
  end

  let :someone_session do
    Session.create!(:identity => someone).key
  end

  let :somegod_session do
    Session.create!(:identity => somegod).key
  end

  let :false_god_session do
    Session.create!(:identity => false_god).key
  end

  let :crook do
    result = Identity.new(:realm => realm)
    result.send(:fingerprints=, ['fingerprint1'])
    result.save!
    result
  end

  let(:checkpoint) {
    checkpoint = double
    checkpoint.stub(:service_url => 'http://example.com')
    checkpoint
  }


{'fraction_non_alphanumeric': 0.13786091907279382, 'fraction_numerical': 0.0065067100447336315, 'mean_word_length': 3.300699300699301, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '3717457', 'n_tokens_mistral': 865, 'n_tokens_neox': 832, 'n_words': 197}