<commit_before>Given(/^I have authorised and part authorised claims$/) do
  @claims = create_list(:authorised_claim, 2, advocate: @advocate)
  @claims += create_list(:part_authorised_claim, 3, advocate: @advocate)
  @other_claims = create_list(:allocated_claim, 3)
end

Given(/^my chamber has authorised and part authorised claims$/) do
  another_advocate = create(:advocate)
  @advocate.chamber.advocates << another_advocate
  @claims = create_list(:authorised_claim, 2)
  @claims += create_list(:part_authorised_claim, 1)
  @claims.each { |claim| claim.update_column(:advocate_id, another_advocate.id) }
  @other_claims = create_list(:allocated_claim, 3)
  @other_claims.each { |claim| claim.update_column(:advocate_id, another_advocate.id) }
end

Then(/^I should see my total value of outstanding claims$/) do
  expect(page).to have_content(@advocate.claims.outstanding.map(&:total).sum)
end

Then(/^I should see the total value of outstanding claims for my chamber$/) do
  expect(page).to have_content(@advocate.claims.outstanding.map(&:total).sum)
end

Then(/^I should see my total value of authorised and part authorised claims$/) do
  expect(page).to have_content(@advocate.claims.any_authorised.map(&:total).sum)
end

Then(/^I should see the total value of authorised and part authorised claims for my chamber$/) do
  expect(page).to have_content(@advocate.claims.any_authorised.map(&:total).sum)
end

When(/^click on the link to view the details of outstanding claims$/) do
  click_link 'outstanding_claim_details'
end

Then(/^I should see a list of outstanding claims$/) do
  claim_dom_ids = @advocate.claims.outstanding.map { |c| "claim_#{c.id}" }
  claim_dom_ids.each do |dom_id|
    expect(page).to have_selector("##{dom_id}")
  end
end
<commit_msg>cannot match standard ruby float against currency<commit_after>Given(/^I have authorised and part authorised claims$/) do
  @claims = create_list(:authorised_claim, 2, advocate: @advocate)
  @claims += create_list(:part_authorised_claim, 3, advocate: @advocate)
  @other_claims = create_list(:allocated_claim, 3)
end

Given(/^my chamber has authorised and part authorised claims$/) do
  another_advocate = create(:advocate)
  @advocate.chamber.advocates << another_advocate
  @claims = create_list(:authorised_claim, 2)
  @claims += create_list(:part_authorised_claim, 1)
  @claims.each { |claim| claim.update_column(:advocate_id, another_advocate.id) }
  @other_claims = create_list(:allocated_claim, 3)
  @other_claims.each { |claim| claim.update_column(:advocate_id, another_advocate.id) }
end

Then(/^I should see my total value of outstanding claims$/) do
  expect(page).to have_content(@advocate.claims.outstanding.map(&:total).sum)
end

Then(/^I should see the total value of outstanding claims for my chamber$/) do
  expect(page).to have_content(@advocate.claims.outstanding.map(&:total).sum)
end

Then(/^I should see my total value of authorised and part authorised claims$/) do
  total = ActiveSupport::NumberHelper.number_to_delimited(@advocate.claims.any_authorised.map(&:amount_assessed).sum)
  expect(page).to have_content(total)
end

Then(/^I should see the total value of authorised and part authorised claims for my chamber$/) do
  expect(page).to have_content(@advocate.claims.any_authorised.map(&:total).sum)
end

When(/^click on the link to view the details of outstanding claims$/) do
  click_link 'outstanding_claim_details'
end

Then(/^I should see a list of outstanding claims$/) do
  claim_dom_ids = @advocate.claims.outstanding.map { |c| "claim_#{c.id}" }
  claim_dom_ids.each do |dom_id|
    expect(page).to have_selector("##{dom_id}")
  end
end

{'fraction_non_alphanumeric': 0.11994497936726273, 'fraction_numerical': 0.003301237964236589, 'mean_word_length': 5.720887245841035, 'pattern_counts': {'":': 0, '<': 7, '<?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': '825898', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1170, 'n_words': 312}