BigW Consortium Gitlab

additional_email_headers_interceptor_spec.rb 482 Bytes
Newer Older
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