<commit_before>require 'spec_helper'
require 'action_controller'
require 'casclient/frameworks/rails/filter'

describe CASClient::Frameworks::Rails::Filter do

  def controller_with_session(request = nil, session={})
    request ||= mock_post_request
    controller = double("Controller")
    controller.stub(:session) {session}
    controller.stub(:request) {request}
    controller.stub(:url_for) {"bogusurl"}
    controller.stub(:params) {{:ticket => "bogusticket", :renew => false}}
    controller
  end

  def mock_post_request
      mock_request = ActionController::Request.new({})
      mock_request.stub(:post?) {true}
      mock_request
  end

  before(:each) do
    CASClient::Frameworks::Rails::Filter.configure(
      :cas_base_url => 'http://test.local/',
      :logger => double("Logger")<commit_msg>Fix broken tests, should have run those locally first :(<commit_after>require 'spec_helper'
require 'action_controller'
require 'casclient/frameworks/rails/filter'

describe CASClient::Frameworks::Rails::Filter do

  def controller_with_session(request = nil, session={})

    query_parameters = {:ticket => "bogusticket", :renew => false}
    parameters = query_parameters.dup

    request ||= mock_post_request
    controller = double("Controller")
    controller.stub(:session) {session}
    controller.stub(:request) {request}
    controller.stub(:url_for) {"bogusurl"}
    controller.stub(:query_parameters) {query_parameters}
    controller.stub(:path_parameters) {{}}
    controller.stub(:parameters) {parameters}
    controller.stub(:params) {parameters}
    controller
  end

  def mock_post_request
      mock_request = ActionController::Request.new({})
      mock_request.stub(:post?) {true}
      mock_request
  end

  before(:each) do
    CASClient::Frameworks::Rails::Filter.configure(
      :cas_base_url => 'http://test.local/',
      :logger => double("Logger")
{'fraction_non_alphanumeric': 0.13424947145877378, 'fraction_numerical': 0.0, 'mean_word_length': 4.701807228915663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6952073', 'n_tokens_mistral': 568, 'n_tokens_neox': 558, 'n_words': 107}