<commit_before>module Features
  module ApplicationHelpers

    def log_in_as_student(student = nil)
      if student.nil?
        student = create(:student)
        student.user.update(phone_verified: true, email_verified: true)
      end
      visit login_path
      fill_in 'Username', with: student.username
      fill_in 'Password', with: <PASSWORD>
      click_button 'Log in'
      sleep(1)
    end

    def register_as_student(student = nil)
      student = create(:student) if student.nil?
      visit register_path
      fill_in "Username", with: student.username
      fill_in "Email", with: student.user.email
      fill_in "Phone", with: student.user.phone
      select student.school.name, from: "student_school_id"
      fill_in "Password", with: <PASSWORD>
      fill_in "Password confirmation", with: <PASSWORD>
      click_button "Submit"
    end

    def register_as_parent(parent = nil)
      parent = create(:parent) if parent.nil?
      visit register_path
      click_link "Parent"
      fill_in "Email", with: parent.user.email
      fill_in "Phone", with: parent.user.phone
      fill_in "Password", with: <PASSWORD>
      fill_in "Password confirmation", with: <PASSWORD>
      click_button "Submit"
    end

  end
end
<commit_msg>Fix bug in parent registration spec<commit_after>module Features
  module ApplicationHelpers

    def log_in_as_student(student = nil)
      if student.nil?
        student = create(:student)
        student.user.update(phone_verified: true, email_verified: true)
      end
      visit login_path
      fill_in 'Username', with: student.username
      fill_in 'Password', with: <PASSWORD>
      click_button 'Log in'
      sleep(1)
    end

    def register_as_student(student = nil)
      student = build(:student) if student.nil?
      visit register_path
      fill_in "Username", with: student.username
      fill_in "Email", with: student.user.email
      fill_in "Phone", with: student.user.phone
      select student.school.name, from: "student_school_id"
      fill_in "Password", with: <PASSWORD>
      fill_in "Password confirmation", with: <PASSWORD>
      click_button "Submit"
    end

    def register_as_parent(parent = nil)
      parent = build(:parent) if parent.nil?
      visit register_path
      click_link "Parent"
      fill_in "Email", with: parent.user.email
      fill_in "Phone", with: parent.user.phone
      fill_in "Password", with: <PASSWORD>
      fill_in "Password confirmation", with: <PASSWORD>
      click_button "Submit"
    end

  end
end

{'fraction_non_alphanumeric': 0.09234411996842937, 'fraction_numerical': 0.0007892659826361484, 'mean_word_length': 2.9733542319749215, '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': '3621521', 'n_tokens_mistral': 754, 'n_tokens_neox': 747, 'n_words': 207}