<commit_before>require 'spec_helper'

describe "Users" do
  before(:each) do
    user = create(:admin_user, :email => "<EMAIL>", :password => "password", :password_confirmation => "password")
    visit spree.admin_path
    fill_in "user_email", :with => user.email
    fill_in "user_password", :with => user.password
    click_button "Login"
    click_link "Users"
    within('table#listing_users td.user_email') { click_link "<EMAIL>" }
    click_link "Edit"
    page.should have_content("Editing User")
  end

  it "admin editing email with validation error" do
    fill_in "user_email", :with => "a"
    click_button "Update"
    page.should have_content("Email is invalid")
  end

  it "admin editing roles" do
    check "user_spree_role_user"
    click_button "Update"
    page.should have_content("User has been successfully updated!")
    within('table#listing_users') { click_link "Edit" }
    find_field('user_spree_role_user')['checked'].should be_true
  end
end<commit_msg>Add user role for user_spec<commit_after>require 'spec_helper'

describe "Users" do
  before(:each) do
    Spree::Role.create!(:name => "user")
    user = create(:admin_user, :email => "<EMAIL>", :password => "password", :password_confirmation => "password")
    visit spree.admin_path
    fill_in "user_email", :with => user.email
    fill_in "user_password", :with => <PASSWORD>
    click_button "Login"
    click_link "Users"
    within('table#listing_users td.user_email') { click_link "<EMAIL>" }
    click_link "Edit"
    page.should have_content("Editing User")
  end

  it "admin editing email with validation error" do
    fill_in "user_email", :with => "a"
    click_button "Update"
    page.should have_content("Email is invalid")
  end

  it "admin editing roles" do
    check "user_spree_role_user"
    click_button "Update"
    page.should have_content("User has been successfully updated!")
    within('table#listing_users') { click_link "Edit" }
    find_field('user_spree_role_user')['checked'].should be_true
  end
end
{'fraction_non_alphanumeric': 0.12376237623762376, 'fraction_numerical': 0.0, 'mean_word_length': 4.403743315508021, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 21, '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': '4980932', 'n_tokens_mistral': 649, 'n_tokens_neox': 638, 'n_words': 165}