<commit_before>Given(/^a collection of cases exist$/) do
  stub_case_collection_api_request
end

Then(/^I can get a list of all merger inquiries$/) do
  visit finder_path('cma-cases')
  page.should have_content('2 cases')

  within '.results .document:nth-child(1)' do
    page.should have_link('HealthCorp / DrugInc merger inquiry')
    page.should have_content('30 December 2003')
    page.should have_content('Merger inquiry')
  end

  within '.results .document:nth-child(2)' do
    page.should have_link('Private healthcare market investigation')
    page.should have_content('14 August 2007')
    page.should have_content('Market investigation')
  end

  select_filters('Case type' => 'Merger inquiries')

  page.should have_content('1 case')

  within '.results .document:nth-child(1)' do
    page.should have_link('HealthCorp / DrugInc merger inquiry')
    page.should have_content('30 December 2003')
    page.should have_content('Merger inquiry')
  end

  page.should have_no_content('Private healthcare market investigation')
end<commit_msg>Refactor filtering step to look at items<commit_after>Given(/^a collection of cases exist$/) do
  stub_case_collection_api_request
end

Then(/^I can get a list of all merger inquiries$/) do
  visit finder_path('cma-cases')
  page.should have_content('2 cases')
  page.should have_css('.results .document', count: 2)

  within '.results .document:nth-child(1)' do
    page.should have_link('HealthCorp / DrugInc merger inquiry')
    page.should have_content('30 December 2003')
    page.should have_content('Merger inquiry')
  end

  select_filters('Case type' => 'Merger inquiries')

  page.should have_content('1 case')
  page.should have_css('.results .document', count: 1)
end
{'fraction_non_alphanumeric': 0.1120739456961294, 'fraction_numerical': 0.019641825534373193, 'mean_word_length': 4.697368421052632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '360234', 'n_tokens_mistral': 568, 'n_tokens_neox': 507, 'n_words': 150}