<commit_before>require "rails_helper"

RSpec.describe ProposalsMailer, type: :mailer do
  describe "new_proposal" do
    
    let(:proposer) { FactoryGirl.create :user }
    let(:contributor) { FactoryGirl.create :user, email: "<EMAIL>" }
    let(:proposal) { FactoryGirl.create :proposal, proposer: contributor }
    let(:mail) { ProposalsMailer.new_proposal(contributor, proposal) }
  
    it "renders the headers" do
      expect(mail.to).to eq(["<EMAIL>"])
      expect(mail.from).to eq(["<EMAIL>"])
      expect(mail.subject).to eq("OpenPolitics Manifesto: new proposal ready for your vote")
    end
  
    it "should include title of proposal" do
      expect(mail.body.encoded).to match(proposal.title)
    end

    it "should include link to vote" do
      expect(mail.body.encoded).to match("https://github.com/#{ENV["GITHUB_REPO"]}/pull/#{proposal.number}")
    end
<commit_msg>fix hardcoded address in test<commit_after>require "rails_helper"

RSpec.describe ProposalsMailer, type: :mailer do
  describe "new_proposal" do
    
    let(:proposer) { FactoryGirl.create :user }
    let(:contributor) { FactoryGirl.create :user, email: "<EMAIL>" }
    let(:proposal) { FactoryGirl.create :proposal, proposer: contributor }
    let(:mail) { ProposalsMailer.new_proposal(contributor, proposal) }
  
    it "renders the headers" do
      expect(mail.to).to eq(["<EMAIL>"])
      expect(mail.from).to eq(["no-reply@#{ENV["EMAIL_DOMAIN"]}"])
      expect(mail.subject).to eq("OpenPolitics Manifesto: new proposal ready for your vote")
    end
  
    it "should include title of proposal" do
      expect(mail.body.encoded).to match(proposal.title)
    end

    it "should include link to vote" do
      expect(mail.body.encoded).to match("https://github.com/#{ENV["GITHUB_REPO"]}/pull/#{proposal.number}")
    end

{'fraction_non_alphanumeric': 0.1393171806167401, 'fraction_numerical': 0.0, 'mean_word_length': 3.8844086021505375, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 2, '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': '4097941', 'n_tokens_mistral': 609, 'n_tokens_neox': 592, 'n_words': 134}