<commit_before>require 'rails_helper'

feature 'Users' do

  scenario 'Sign up' do
    visit '/'
    click_link 'Sign up'

    fill_in 'user_first_name',            with: 'Manuela'
    fill_in 'user_last_name',             with: 'Carmena'
    fill_in 'user_email',                 with: '<EMAIL>'
    fill_in 'user_password',              with: '<PASSWORD>'
    fill_in 'user_password_confirmation', with: '<PASSWORD>'

    click_button 'Sign up'

    expect(page).to have_content "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
  end

  scenario 'Sign in' do
    user = create(:user, email: '<EMAIL>', password: '<PASSWORD>')

    visit '/'
    click_link 'Log in'
    fill_in 'user_email',    with: '<EMAIL>'
    fill_in 'user_password', with: '<PASSWORD>'
    click_button 'Log in'

    expect(page).to have_content 'Signed in successfully.'
  end

  scenario 'Sign out' do<commit_msg>adds spec step to confirm email after sign up rel: #44<commit_after>require 'rails_helper'

feature 'Users' do

  scenario 'Sign up' do
    visit '/'
    click_link 'Sign up'

    fill_in 'user_first_name',            with: 'Manuela'
    fill_in 'user_last_name',             with: 'Carmena'
    fill_in 'user_email',                 with: '<EMAIL>'
    fill_in 'user_password',              with: '<PASSWORD>'
    fill_in 'user_password_confirmation', with: '<PASSWORD>'

    click_button 'Sign up'

    expect(page).to have_content "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."

    sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1]
    visit user_confirmation_path(confirmation_token: sent_token)

    expect(page).to have_content "Your email address has been successfully confirmed"
  end

  scenario 'Sign in' do
    user = create(:user, email: '<EMAIL>', password: '<PASSWORD>')

    visit '/'
    click_link 'Log in'
    fill_in 'user_email',    with: '<EMAIL>'
    fill_in 'user_password', with: '<PASSWORD>'
    click_button 'Log in'

    expect(page).to have_content 'Signed in successfully.'
  end

  scenario 'Sign out' do
{'fraction_non_alphanumeric': 0.11246063877642826, 'fraction_numerical': 0.001349527665317139, 'mean_word_length': 3.1570093457943926, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4524837', 'n_tokens_mistral': 699, 'n_tokens_neox': 687, 'n_words': 213}