<commit_before><commit_msg>Created a feature spec for locking user accounts<commit_after>require 'rails_helper'

RSpec.describe 'User account is locked', type: :feature do

  let(:user) { create(:user) }

  scenario 'Lockable account after 10 failed attempts' do
    visit new_user_session_path

    20.times do
      fill_in 'user_email', with: user.email
      fill_in 'user_password', with: 'password'
      click_on 'Log in'
      user.reload
      puts user.failed_attempts
    end

    assert_equal 10, user.failed_attempts
    fill_in 'user_email', with: user.email
    fill_in 'user_password', with: 'password'
    click_on 'Log in'
    expect(page).to have_content 'Your account is locked.'
  end
end
{'fraction_non_alphanumeric': 0.08603667136812412, 'fraction_numerical': 0.00846262341325811, 'mean_word_length': 3.6710526315789473, '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': '2875190', 'n_tokens_mistral': 230, 'n_tokens_neox': 217, 'n_words': 68}