<commit_before>require 'feature_helper'
require 'i18n'

RSpec.describe 'When the user visits the select documents page' do
  before(:each) do
    set_session_cookies!
  end

  it 'displays the page in Welsh' do
    visit '/dewiswch-ddogfennau'
    expect(page).to have_title 'Dewiswch yr holl ddogfennau sydd gennych - GOV.UK Verify - GOV.UK'
    expect(page).to have_css 'html[lang=cy]'
  end

  it 'includes the appropriate feedback source' do
    visit '/select-documents'

    expect_feedback_source_to_be(page, 'SELECT_DOCUMENTS_PAGE')
  end

  it 'redirects to the select phone page when user has a driving licence' do
    visit '/select-documents'

    choose 'select_documents_form_uk_driving_licence_true'
    click_button 'Continue'

    expect(page).to have_current_path(select_phone_path)
  end

  it 'redirects to the select phone page when no docs checked' do
    visit '/select-documents'

    check I18n.translate('hub.select_documents.question.no_docs')
    click_button 'Continue'

    expect(page).to have_current_path(select_phone_path)
  end

  context 'will validate selections', js: false do
    it 'will show an error message when no selections have been made' do
      visit 'select-documents'

      click_button 'Continue'

      expect(page).to have_content 'Please select the documents you have'
    end
    it 'will show an error message when no selections have been made' do
      visit 'select-documents'

      click_button 'Continue'

      expect(page).to have_content 'Please select the documents you have'
    end
  end
end<commit_msg>3341 Got rid of a duplicate test<commit_after>require 'feature_helper'
require 'i18n'

RSpec.describe 'When the user visits the select documents page' do
  before(:each) do
    set_session_cookies!
  end

  it 'displays the page in Welsh' do
    visit '/dewiswch-ddogfennau'
    expect(page).to have_title 'Dewiswch yr holl ddogfennau sydd gennych - GOV.UK Verify - GOV.UK'
    expect(page).to have_css 'html[lang=cy]'
  end

  it 'includes the appropriate feedback source' do
    visit '/select-documents'

    expect_feedback_source_to_be(page, 'SELECT_DOCUMENTS_PAGE')
  end

  it 'redirects to the select phone page when user has a driving licence' do
    visit '/select-documents'

    choose 'select_documents_form_uk_driving_licence_true'
    click_button 'Continue'

    expect(page).to have_current_path(select_phone_path)
  end

  it 'redirects to the select phone page when no docs checked' do
    visit '/select-documents'

    check I18n.translate('hub.select_documents.question.no_docs')
    click_button 'Continue'

    expect(page).to have_current_path(select_phone_path)
  end

  context 'will validate selections', js: false do
    it 'will show an error message when no selections have been made' do
      visit 'select-documents'

      click_button 'Continue'

      expect(page).to have_content 'Please select the documents you have'
    end
  end
end
{'fraction_non_alphanumeric': 0.07198641765704585, 'fraction_numerical': 0.0040747028862478775, 'mean_word_length': 3.790243902439024, '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': '2365337', 'n_tokens_mistral': 965, 'n_tokens_neox': 891, 'n_words': 297}