<commit_before>require 'test_helper'

class UsersControllerTest < ActionDispatch::IntegrationTest
  before do
    @user = create :user, role: 'admin'
    @user_2 = create :user, role: 'cm', name: '<NAME>'
    @patient_1 = create :patient, name: '<NAME>'
    @patient_2 = create :patient, name: '<NAME>'

    sign_in @user
  end

  describe 'authentication for restricted endpoints' do
    %w[users_path new_user_path].each do |endpoint|
      it "should redirect if user is not admin - #{endpoint}" do<commit_msg>autoretry failures on the flaky create user test (#2347)<commit_after>require 'test_helper'

class UsersControllerTest < ActionDispatch::IntegrationTest
  extend Minitest::OptionalRetry

  before do
    @user = create :user, role: 'admin'
    @user_2 = create :user, role: 'cm', name: '<NAME>'
    @patient_1 = create :patient, name: '<NAME>'
    @patient_2 = create :patient, name: '<NAME>'

    sign_in @user
  end

  describe 'authentication for restricted endpoints' do
    %w[users_path new_user_path].each do |endpoint|
      it "should redirect if user is not admin - #{endpoint}" do
{'fraction_non_alphanumeric': 0.11514052583862194, 'fraction_numerical': 0.009066183136899365, 'mean_word_length': 4.257142857142857, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '2260984', 'n_tokens_mistral': 342, 'n_tokens_neox': 331, 'n_words': 113}