<commit_before>require 'test_helper'

class UserTest < ActionDispatch::IntegrationTest
  setup do
    @user = User.make!(name: '<NAME>', password: '<PASSWORD>!')
  end

  test 'should be able to login' do
    login_user(@user)
    assert_match current_path, '/'
    assert_match /Signed in successfully/, page.body
  end

  test 'should be able to register a new account' do
    team = Team.make!
    visit new_user_registration_path
    fill_in 'user_name', with: '<NAME>'
    fill_in 'user_email', with: '<EMAIL>'
    fill_in 'user_password', with: '<PASSWORD>!'
    fill_in 'user_password_confirmation', with: '<PASSWORD>!'
    select team.name, from: 'user_team_id'
    click_button 'Sign up'
    
    assert_match current_path, '/'
    assert_match /Welcome! You have signed up successfully/, page.body
  end

  test 'should be able to edit an account' do
    login_user(@user)
    click_link '<NAME>'
    fill_in 'user_name', with: '<NAME>'
    fill_in 'user_current_password', with: '<PASSWORD>!'
    click_button 'Update'
    assert_match /You updated your account successfully/, page.body
    assert_match /Jane Doe/, page.body
  end

  test 'should be able to close an account' do
    login_user(@user)
    click_link '<NAME>'
    assert_difference 'User.count', -1 do
      click_button 'Cancel my account'
    end
  end
end
<commit_msg>Removing shoulds in test cases<commit_after>require 'test_helper'

class UserTest < ActionDispatch::IntegrationTest
  setup do
    @user = User.make!(name: '<NAME>', password: '<PASSWORD>!')
  end

  test 'User login' do
    login_user(@user)
    assert_match current_path, '/'
    assert_match /Signed in successfully/, page.body
  end

  test 'New account registration' do
    team = Team.make!
    visit new_user_registration_path
    fill_in 'user_name', with: '<NAME>'
    fill_in 'user_email', with: '<EMAIL>'
    fill_in 'user_password', with: '<PASSWORD>!'
    fill_in 'user_password_confirmation', with: '<PASSWORD>!'
    select team.name, from: 'user_team_id'
    click_button 'Sign up'
    
    assert_match current_path, '/'
    assert_match /Welcome! You have signed up successfully/, page.body
  end

  test 'Editing an account' do
    login_user(@user)
    click_link '<NAME>'
    fill_in 'user_name', with: '<NAME>'
    fill_in 'user_current_password', with: '<PASSWORD>!'
    click_button 'Update'
    assert_match /You updated your account successfully/, page.body
    assert_match /Jane Doe/, page.body
  end

  test 'Closing an account' do
    login_user(@user)
    click_link '<NAME>'
    assert_difference 'User.count', -1 do
      click_button 'Cancel my account'
    end
  end
end

{'fraction_non_alphanumeric': 0.11006407840180928, 'fraction_numerical': 0.0007538635506973238, 'mean_word_length': 3.5996533795493932, 'pattern_counts': {'":': 0, '<': 25, '<?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': '4797853', 'n_tokens_mistral': 855, 'n_tokens_neox': 838, 'n_words': 256}