<commit_before>require 'rails_helper'
require 'support/spec_login_helper'

feature 'User management' do
  scenario 'User can create a new user' do

    user = create(:osu_auth_user)
    set_permissions(user, %w(add_user view_users))
    login(user)
    visit '/admin/users/new'
    # save_and_open_page

    fill_in 'First Name', with: 'Bob'
    fill_in 'Last Name', with: 'Smith'
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Name.#', with: 'smith.1'
    click_button 'Create User'

    expect(page).to have_text('User was successfully created.')
  end
end<commit_msg>Added user editing test<commit_after>require 'rails_helper'
require 'support/spec_login_helper'

feature 'User management' do
  scenario 'User can create a new user' do

    user = create(:osu_auth_user)
    set_permissions(user, %w(add_user view_users))
    login(user)
    visit '/admin/users/new'
    # save_and_open_page

    fill_in 'First Name', with: 'Bob'
    fill_in 'Last Name', with: 'Smith'
    fill_in 'Email', with: '<EMAIL>'
    fill_in 'Name.#', with: 'smith.1'
    click_button 'Create User'

    expect(page).to have_text('User was successfully created.')
  end

  scenario 'User can edit a user' do

    user = create(:osu_auth_user)
    set_permissions(user, %w(edit_user view_users))
    login(user)
    visit '/admin/users'
    click_link 'Edit'

    fill_in 'First Name', with: 'Bob'
    click_button 'Update User'

    expect(page).to have_text('User was successfully updated.')
  end
end
{'fraction_non_alphanumeric': 0.11717171717171718, 'fraction_numerical': 0.0013468013468013469, 'mean_word_length': 3.824675324675325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6978628', 'n_tokens_mistral': 515, 'n_tokens_neox': 500, 'n_words': 139}