<commit_before>require 'spec_helper'

describe I18nHelper do
  let(:user) { create(:user) }<commit_msg>Reset I18n.locale to not affect other specs<commit_after>require 'spec_helper'

describe I18nHelper do
  let(:user) { create(:user) }

  # In the real world, the helper is called in every request and sets
  # I18n.locale to the chosen locale or the default. For testing purposes we
  # have to restore I18n.locale for unit tests that don't call the helper, but
  # rely on translated strings.
  around do |example|
    locale = I18n.locale
    example.run
    I18n.locale = locale
  end
{'fraction_non_alphanumeric': 0.07640067911714771, 'fraction_numerical': 0.023769100169779286, 'mean_word_length': 3.957983193277311, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4206459', 'n_tokens_mistral': 191, 'n_tokens_neox': 178, 'n_words': 71}