<commit_before>require "rails_helper"

RSpec.describe EventMailer, type: :mailer do
  before do
    allow_any_instance_of(Event).to receive(:ical_valid?).and_call_original
    @unit = FactoryGirl.create(:unit)
    @recipient = FactoryGirl.create(:adult)
    @recipient.units << @unit
    @event = FactoryGirl.create(:event, unit: @unit)
    @event.reload
  end


  describe "reminder" do
    let(:mail) { EventMailer.reminder(@event, @recipient) }

    it "renders the headers" do
      expect(mail.subject).to eq("[CS Pack 134] USS Midway Overnight - Reminder")
      expect(mail.to).to eq([@recipient.email])
      expect(mail.from).to eq(['<EMAIL>'])
    end

    it 'renders unsubscribe block' do
      expect(mail.body.encoded).to include("UNSUBSCRIBE")
      expect(mail.body.encoded).to include("All times (GMT-07:00) Arizona")
      expect(mail.body.encoded).to include("<a href=\"http://www.testing.com/unsubscribe/event_reminder_email?id=#{@recipient.signup_token}\">")
    end

    it 'renders the body' do
      expect(mail.body.encoded).to include("USS Midway Overnight")
      expect(mail.body.encoded).to include("<img src=\"http://www.testing.com/assets/ical_email.png\"")
    end
  end

end<commit_msg>fix spec fail, a href change<commit_after>require "rails_helper"

RSpec.describe EventMailer, type: :mailer do
  before do
    allow_any_instance_of(Event).to receive(:ical_valid?).and_call_original
    @unit = FactoryGirl.create(:unit)
    @recipient = FactoryGirl.create(:adult)
    @recipient.units << @unit
    @event = FactoryGirl.create(:event, unit: @unit)
    @event.reload
  end


  describe "reminder" do
    let(:mail) { EventMailer.reminder(@event, @recipient) }

    it "renders the headers" do
      expect(mail.subject).to eq("[CS Pack 134] USS Midway Overnight - Reminder")
      expect(mail.to).to eq([@recipient.email])
      expect(mail.from).to eq(['<EMAIL>'])
    end

    it 'renders unsubscribe block' do
      expect(mail.body.encoded).to include("UNSUBSCRIBE")
      expect(mail.body.encoded).to include("All times (GMT-07:00) Arizona")
      expect(mail.body.encoded).to include("href=\"http://www.testing.com/unsubscribe/event_reminder_email?id=#{@recipient.signup_token}\"")
    end

    it 'renders the body' do
      expect(mail.body.encoded).to include("USS Midway Overnight")
      expect(mail.body.encoded).to include("<img src=\"http://www.testing.com/assets/ical_email.png\"")
    end
  end

end
{'fraction_non_alphanumeric': 0.14740710494079215, 'fraction_numerical': 0.0057166190281747655, 'mean_word_length': 3.8514851485148514, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '2956154', 'n_tokens_mistral': 844, 'n_tokens_neox': 805, 'n_words': 159}