<commit_before>require 'rails_helper'
require 'spec_helper'

feature 'Creating a new user' do
  background do
    visit '/'
    click_on 'Register'
  end

  scenario 'can create a new user via the index page' do
    fill_in 'Username', with: 'sxyrailsdev'
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Password', with: '<PASSWORD>', match: :prefer_exact
    fill_in 'Password confirmation', with: '<PASSWORD>', match: :prefer_exact
    click_on 'Sign Up'

    expect(page.current_path).to eq '/posts'
    expect(page).to have_content 'Welcome! Registration successful.'
  end

  scenario 'requires a user name to successfully create an account' do
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Password', with: '<PASSWORD>', match: :prefer_exact
    fill_in 'Password confirmation', with: '<PASSWORD>', match: :prefer_exact
    click_on 'Sign Up'

    expect(page).to have_content "Username can't be blank"
  end

  scenario 'requires a username to be more than 4 characters' do
    fill_in 'Username', with: 'h'
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Password', with: '<PASSWORD>', match: :prefer_exact
    fill_in 'Password confirmation', with: '<PASSWORD>', match: :prefer_exact
    click_on 'Sign Up'

    expect(page).to have_content 'Username is too short (minimum is 4 characters)'


  end
end<commit_msg>fix incorrect route in spec<commit_after>require 'rails_helper'
require 'spec_helper'

feature 'Creating a new user' do
  background do
    visit '/'
    click_on 'Register'
  end

  scenario 'can create a new user via the index page' do
    fill_in 'Username', with: 'sxyrailsdev'
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Password', with: '<PASSWORD>', match: :prefer_exact
    fill_in 'Password confirmation', with: '<PASSWORD>', match: :prefer_exact
    click_on 'Sign Up'

    expect(page.current_path).to eq '/'
    expect(page).to have_content 'Welcome! Registration successful.'
  end

  scenario 'requires a user name to successfully create an account' do
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Password', with: '<PASSWORD>', match: :prefer_exact
    fill_in 'Password confirmation', with: '<PASSWORD>', match: :prefer_exact
    click_on 'Sign Up'

    expect(page).to have_content "Username can't be blank"
  end

  scenario 'requires a username to be more than 4 characters' do
    fill_in 'Username', with: 'h'
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Password', with: '<PASSWORD>', match: :prefer_exact
    fill_in 'Password confirmation', with: '<PASSWORD>', match: :prefer_exact
    click_on 'Sign Up'

    expect(page).to have_content 'Username is too short (minimum is 4 characters)'


  end
end
{'fraction_non_alphanumeric': 0.11876138433515483, 'fraction_numerical': 0.0014571948998178506, 'mean_word_length': 4.1135940409683425, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '4028020', 'n_tokens_mistral': 888, 'n_tokens_neox': 855, 'n_words': 300}