<commit_before>require 'rails_helper'

describe User do
  context 'logged' do
    let(:user) { create :user }
    before { login_with user.username, user.password }

    it 'edits account data' do
      visit self_show_path

      expect(page).to have_content user.fullname

      click_link 'Edit account data'

      fullname = 'emmeline vance'
      fill_in 'user_fullname', with: fullname
      click_button 'Edit account data'

      expect(page).to have_content I18n.t('chaltron.users.self_updated')
      expect(page).to have_content fullname
    end

  end
end
<commit_msg>add test for changing password<commit_after>require 'rails_helper'

describe User do
  context 'logged' do
    let(:user) { create :user }
    before { login_with user.username, user.password }

    it 'edits account data' do
      visit self_show_path
      expect(page).to have_content user.fullname

      click_link 'Edit account data'

      fullname = 'emmeline vance'
      fill_in 'user_fullname', with: fullname
      click_button 'Edit account data'

      expect(page).to have_content I18n.t('chaltron.users.self_updated')
      expect(page).to have_content fullname
    end

    it 'changes password' do
      visit self_show_path
      expect(page).to have_content user.fullname

      click_link 'Edit account data'

      password = '<PASSWORD>'
      fill_in 'user_password', with: password
      fill_in 'user_password_confirmation', with: password
      click_button 'Edit account data'

      expect(page).to have_content I18n.t('chaltron.users.self_updated')

      logout
      login_with user.username, password
      expect(page).to have_content I18n.t('devise.sessions.signed_in')
    end


  end
end

{'fraction_non_alphanumeric': 0.08264947245017586, 'fraction_numerical': 0.004689331770222743, 'mean_word_length': 3.1634146341463416, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6789280', 'n_tokens_mistral': 547, 'n_tokens_neox': 515, 'n_words': 140}