<commit_before>require 'spec_helper'
require 'models/session_validator'
require 'models/session_validator/session_id_validator'
require 'models/session_validator/session_start_time_validator'
require 'models/session_validator/missing_cookies_validator'
require 'models/session_validator/cookie_size_validator'
require 'models/session_validator/no_cookies_validator'
require 'models/session_validator/validation'
require 'models/session_validator/successful_validation'
require 'models/session_validator/validation_failure'
require 'models/session_validator/transaction_simple_id_presence'
require 'models/cookie_names'
require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/date_time'
require 'active_support/core_ext/integer/time'

describe SessionValidator do
  let(:cookies) {
    {
      CookieNames::SESSION_ID_COOKIE_NAME => 'my-session-id',
      CookieNames::SECURE_COOKIE_NAME => 'my-secure-cookie'
    }
  }

  let(:session) {
    {
      transaction_simple_id: 'simple-id'
    }
  }

  let(:good_session) {
    {
      transaction_simple_id: 'simple-id',
      start_time: DateTime.now.to_i * 1000,
      'verify_session_id' => 'session_id',
    }
  }

  let(:session_expiry) { 2 }
  let(:session_validator) {
    SessionValidator.new(session_expiry)
  }<commit_msg>5037: Refer to verify session cookie using symbol.<commit_after>require 'spec_helper'
require 'models/session_validator'
require 'models/session_validator/session_id_validator'
require 'models/session_validator/session_start_time_validator'
require 'models/session_validator/missing_cookies_validator'
require 'models/session_validator/cookie_size_validator'
require 'models/session_validator/no_cookies_validator'
require 'models/session_validator/validation'
require 'models/session_validator/successful_validation'
require 'models/session_validator/validation_failure'
require 'models/session_validator/transaction_simple_id_presence'
require 'models/cookie_names'
require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/date_time'
require 'active_support/core_ext/integer/time'

describe SessionValidator do
  let(:cookies) {
    {
      CookieNames::SESSION_ID_COOKIE_NAME => 'my-session-id',
      CookieNames::SECURE_COOKIE_NAME => 'my-secure-cookie'
    }
  }

  let(:session) {
    {
      transaction_simple_id: 'simple-id'
    }
  }

  let(:good_session) {
    {
      transaction_simple_id: 'simple-id',
      start_time: DateTime.now.to_i * 1000,
      verify_session_id: 'session_id',
    }
  }

  let(:session_expiry) { 2 }
  let(:session_validator) {
    SessionValidator.new(session_expiry)
  }
{'fraction_non_alphanumeric': 0.10056925996204934, 'fraction_numerical': 0.005313092979127135, 'mean_word_length': 5.623115577889447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '2349450', 'n_tokens_mistral': 844, 'n_tokens_neox': 850, 'n_words': 113}