<commit_before># frozen_string_literal: true

require 'spec_helper'

describe 'creating incidents as a driver' do
  before(:each) { when_current_user_is :driver }
  it 'brings drivers directly to the form' do
    visit incidents_url
    find('button', text: 'New Incident').click
    expect(page).to have_text 'Editing Driver Account of Incident'
    driver_report = Incident.last.driver_incident_report
    expect(page.current_url).to end_with edit_incident_report_path(driver_report)
  end
  it 'requires base fields' do
    visit new_incident_url
    click_on 'Save report'
    expect(page).to have_text 'This incident report has 7 missing values and so cannot be marked as completed.'
    expect(page).to have_text "Date and time of incident can't be blank"
    expect(page).to have_text "Location can't be blank"
    expect(page).to have_text "Town can't be blank"
    expect(page).to have_text "Bus # can't be blank"
    expect(page).to have_text "Direction bus was travelling can't be blank"
    expect(page).to have_text "Describe the incident in detail. can't be blank"
    expect(page).to have_text "ZIP can't be blank"
  end
  it 'only requires bus, location, and town' do
    visit new_incident_url
    fill_in_base_incident_fields
    click_on 'Save report'
    expect(page.current_url).to end_with incident_path(Incident.last, format: :pdf)
  end
end<commit_msg>Update test<commit_after># frozen_string_literal: true

require 'spec_helper'

describe 'creating incidents as a driver' do
  before(:each) { when_current_user_is :driver }
  it 'brings drivers directly to the form' do
    visit incidents_url
    find('button', text: 'New Incident').click
    expect(page).to have_text 'Editing Driver Account of Incident'
    driver_report = Incident.last.driver_incident_report
    expect(page.current_url).to end_with edit_incident_report_path(driver_report)
  end
  it 'requires base fields' do
    visit new_incident_url
    click_on 'Save report'
    expect(page).to have_text 'This incident report has 6 missing values and so cannot be marked as completed.'
    expect(page).to have_text "Date and time of incident can't be blank"
    expect(page).to have_text "Location can't be blank"
    expect(page).to have_text "Town can't be blank"
    expect(page).to have_text "Bus # can't be blank"
    expect(page).to have_text "Direction bus was travelling can't be blank"
    expect(page).to have_text "Describe the incident in detail. can't be blank"
  end
  it 'only requires bus, location, and town' do
    visit new_incident_url
    fill_in_base_incident_fields
    click_on 'Save report'
    expect(page.current_url).to end_with incident_path(Incident.last, format: :pdf)
  end
end
{'fraction_non_alphanumeric': 0.07928862541682105, 'fraction_numerical': 0.0007410151908114116, 'mean_word_length': 4.346534653465347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5273039', 'n_tokens_mistral': 843, 'n_tokens_neox': 821, 'n_words': 282}