<commit_before>Given(/^the feature flag for full register content PDF is turned on$/) do
  ENV['SHOW_FULL_TITLE_PDF'] = 'true'
end

Given(/^that I attempt to view the PDF for a title$/) do
  insert_title_with_owners
  visit_title_register_pdf(@title[:title_number])
  convert_pdf_to_page
end

Then(/^the PDF is displayed$/) do
  expect(@pdf_text[0]).to include(@title[:title_number])
end

Given(/^the feature flag for full register content PDF is turned off$/) do
  ENV['SHOW_FULL_TITLE_PDF'] = 'false'
end

Then(/^the PDF Download button is not displayed$/) do
  expect(page).has_no_link?('download-link')
end

Then(/^that titles full register is displayed on the PDF$/) do
  expect(@pdf_text[0]).to include(@title[:title_number])
end

Given(/^I visit the title register summary page$/) do
  insert_title_with_owners
  visit_title_register_page(@title[:title_number])
end

Then(/^the PDF Download button is displayed$/) do
  expect(page).has_link?('download-link')
end<commit_msg>Fix PDF button-related tests<commit_after>Given(/^the feature flag for full register content PDF is turned on$/) do
  ENV['SHOW_FULL_TITLE_PDF'] = 'true'
end

Given(/^that I attempt to view the PDF for a title$/) do
  insert_title_with_owners
  visit_title_register_pdf(@title[:title_number])
  convert_pdf_to_page
end

Then(/^the PDF is displayed$/) do
  expect(@pdf_text[0]).to include(@title[:title_number])
end

Given(/^the feature flag for full register content PDF is turned off$/) do
  ENV['SHOW_FULL_TITLE_PDF'] = 'false'
end

Then(/^the PDF Download button is not displayed$/) do
  expect(page).not_to have_link('download-link')
end

Then(/^that titles full register is displayed on the PDF$/) do
  expect(@pdf_text[0]).to include(@title[:title_number])
end

Given(/^I visit the title register summary page$/) do
  insert_title_with_owners
  visit_title_register_page(@title[:title_number])
end

Then(/^the PDF Download button is displayed$/) do
  expect(page).to have_link('download-link')
end
{'fraction_non_alphanumeric': 0.11945564516129033, 'fraction_numerical': 0.0020161290322580645, 'mean_word_length': 5.551155115511551, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5406008', 'n_tokens_mistral': 654, 'n_tokens_neox': 637, 'n_words': 196}