<commit_before>require "rails_helper"
include Warden::Test::Helpers

describe "Letters of Support" do
  let(:user) { create :user }
  let(:form_answer) { create :form_answer, :promotion, user: user }
  let!(:settings) { create :settings, :submission_deadlines }

  before do
    login_as user
    visit form_form_answer_supporters_path(form_answer)
  end

  it "should be able to create supporter" do
    save_and_open_page
    click_link "+ Add another supporter"
    fill_in "First name", with: "Jack"
    fill_in "Last name", with: "Lee"
    fill_in "Relationship to nominee", with: "Brother"
    fill_in "Email", with: "<EMAIL>"
    click_button "Send support request"

    expect(page).to have_content("<EMAIL>")
  end

  it "should be able to upload support letter" do
    click_link "+ Add another support letter"

    fill_in "First name", with: "Jack"
    fill_in "Last name", with: "Lee"
    fill_in "Relationship to nominee", with: "Brother"
    attach_file "Attachment", Rails.root.join("spec/fixtures/cat.jpg")
    click_button "Submit letter of support"

    expect(page).to have_link("cat.jpg")
  end
end<commit_msg>remove debug output from tests [ci skip]<commit_after>require "rails_helper"
include Warden::Test::Helpers

describe "Letters of Support" do
  let(:user) { create :user }
  let(:form_answer) { create :form_answer, :promotion, user: user }
  let!(:settings) { create :settings, :submission_deadlines }

  before do
    login_as user
    visit form_form_answer_supporters_path(form_answer)
  end

  it "should be able to create supporter" do
    click_link "+ Add another supporter"
    fill_in "First name", with: "Jack"
    fill_in "Last name", with: "Lee"
    fill_in "Relationship to nominee", with: "Brother"
    fill_in "Email", with: "<EMAIL>"
    click_button "Send support request"

    expect(page).to have_content("<EMAIL>")
  end

  it "should be able to upload support letter" do
    click_link "+ Add another support letter"

    fill_in "First name", with: "Jack"
    fill_in "Last name", with: "Lee"
    fill_in "Relationship to nominee", with: "Brother"
    attach_file "Attachment", Rails.root.join("spec/fixtures/cat.jpg")
    click_button "Submit letter of support"

    expect(page).to have_link("cat.jpg")
  end
end
{'fraction_non_alphanumeric': 0.11120917917034422, 'fraction_numerical': 0.0, 'mean_word_length': 4.152272727272727, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4228068', 'n_tokens_mistral': 745, 'n_tokens_neox': 712, 'n_words': 226}