<commit_before>require 'spec_helper'

feature 'Projects API' do
  let(:user)                  { create(:user, password: '<PASSWORD>') }
  let(:red_project)           { Project.find_by(code: 'ALRE') }
  let(:aggregate_project)     { AggregateProject.find_by(name: 'Aggregation') }
  let!(:project_with_tracker) { create(:project_with_tracker_integration, code: "xxxx") }

  background { log_in user, 'jeffjeff' }

  def json_response
    MultiJson.load(page.driver.response.body)
  end

  scenario 'Index API (GET #index)', js: false do
    page.driver.get '/projects.json'
<commit_msg>Fix test failure introduced when serializing project code.<commit_after>require 'spec_helper'

feature 'Projects API' do
  let(:user)                  { create(:user, password: '<PASSWORD>') }
  let(:red_project)           { Project.find_by(name: 'Red Currently Building') }
  let(:aggregate_project)     { AggregateProject.find_by(name: 'Aggregation') }
  let!(:project_with_tracker) { create(:project_with_tracker_integration, code: "xxxx") }

  background { log_in user, 'jeffjeff' }

  def json_response
    MultiJson.load(page.driver.response.body)
  end

  scenario 'Index API (GET #index)', js: false do
    page.driver.get '/projects.json'

{'fraction_non_alphanumeric': 0.1305758313057583, 'fraction_numerical': 0.0, 'mean_word_length': 4.036734693877551, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7135316', 'n_tokens_mistral': 406, 'n_tokens_neox': 393, 'n_words': 85}