summaryrefslogtreecommitdiff
path: root/spec/lib/additional_email_headers_interceptor_spec.rb
blob: 580450eef1e5f17e551d9742d4a082bf34aac21c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require 'spec_helper'

describe AdditionalEmailHeadersInterceptor do
  it 'adds Auto-Submitted header' do
    mail = ActionMailer::Base.mail(to: 'test@mail.com', from: 'info@mail.com', body: 'hello').deliver

    expect(mail.header['To'].value).to eq('test@mail.com')
    expect(mail.header['From'].value).to eq('info@mail.com')
    expect(mail.header['Auto-Submitted'].value).to eq('auto-generated')
    expect(mail.header['X-Auto-Response-Suppress'].value).to eq('All')
  end
end