<commit_before>require_relative '../spec_helper'

describe "Contact Form", api: true, vcr: VCR_OPTS do

    it "can submit" do
        expect {
            response = post(
                '/contact',
                {'name'=>'Bob', 'email'=>'<EMAIL>', 'subject'=>'hi', 'message'=>'this is a test'}
            )
            expect(response.status).to eq 302
            expect(response.location).to match /\/contact-submitted$/
        }.to change { Mail::TestMailer.deliveries.count }.by(1)
        email = Mail::TestMailer.deliveries.last
        expect(email.to).to eq([Hippo.config.support_email])
        expect(email.subject).to eq '[Show Maker Contact] hi'
        expect(email.reply_to).to eq ['<EMAIL>']
        expect(email.body.to_s).to include 'Contact form submission from Bob <EMAIL>'
        expect(email.body.to_s).to include 'this is a test'
    end

end<commit_msg>update to use product_name<commit_after>require_relative '../spec_helper'

describe "Contact Form", api: true, vcr: VCR_OPTS do

    it "can submit" do
        expect {
            response = post(
                '/contact',
                {'name'=>'Bob', 'email'=>'<EMAIL>', 'subject'=>'hi', 'message'=>'this is a test'}
            )
            expect(response.status).to eq 302
            expect(response.location).to match /\/contact-submitted$/
        }.to change { Mail::TestMailer.deliveries.count }.by(1)
        email = Mail::TestMailer.deliveries.last
        expect(email.to).to eq([Hippo.config.support_email])
        expect(email.subject).to eq "[#{Hippo.config.product_name} Contact] hi"
        expect(email.reply_to).to eq ['<EMAIL>']
        expect(email.body.to_s).to include 'Contact form submission from Bob <EMAIL>'
        expect(email.body.to_s).to include 'this is a test'
    end

end
{'fraction_non_alphanumeric': 0.1461923290717065, 'fraction_numerical': 0.0044469149527515284, 'mean_word_length': 2.481624758220503, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, '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': '1541737', 'n_tokens_mistral': 558, 'n_tokens_neox': 547, 'n_words': 129}