<commit_before>require 'spec_helper'

feature 'User management' do
  scenario "adds a new user" do
    admin = create(:admin)

    visit root_path
    click_link 'Log In'
    fill_in 'Email', with: admin.email
    fill_in 'Password', with: <PASSWORD>
    click_button 'Log In'

    visit root_path
    expect{
      click_link 'Users'
      clicl_link 'New User'
      fill_in 'Email', with: '<EMAIL>'
      find('#password').fill_in 'Password', with: '<PASSWORD>'
      find('#password_confirmation').fill_in 'Password confirmation', with: '<PASSWORD>'
      click_button 'Create User'
    }.to change(User, :count).by(1)
    expect(current_path).to eq user_path
    expect(page).to have_content 'New user created'
    within 'h1' do
      expect(page).to have_content 'Users'
    end
    expect(page).to have_content '<EMAIL>'
  end
end<commit_msg>add save_and_open_page<commit_after>require 'spec_helper'

feature 'User management' do
  scenario "adds a new user" do
    admin = create(:admin)
   sign_in admin

    visit root_path
    click_link 'Log In'
    fill_in 'Email', with: admin.email
    fill_in 'Password', with: <PASSWORD>
    click_button 'Log In'

    visit root_path
    expect{
      click_link 'Users'
      clicl_link 'New User'
      fill_in 'Email', with: '<EMAIL>'
      find('#password').fill_in 'Password', with: '<PASSWORD>'
      find('#password_confirmation').fill_in 'Password confirmation', with: '<PASSWORD>'
      click_button 'Create User'
    }.to change(User, :count).by(1)

    save_and_open_page

    expect(current_path).to eq user_path
    expect(page).to have_content 'New user created'
    within 'h1' do
      expect(page).to have_content 'Users'
    end
    expect(page).to have_content '<EMAIL>.com'
  end
end
{'fraction_non_alphanumeric': 0.1168091168091168, 'fraction_numerical': 0.002279202279202279, 'mean_word_length': 3.4231738035264483, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5689542', 'n_tokens_mistral': 571, 'n_tokens_neox': 564, 'n_words': 157}