Topic: Email test fails with custom header

Testing the code for a simple contact form with a custom email header

Code for contact form send:

  def contact_us(sent_at = Time.now, 
                 subjectLine = "Default Subject",
                 senderName = "company",
                 senderEmail = "email@company.com",
                 message = "empty text" )
    @subject    = subjectLine
    @body       = { :name => senderName, :email => senderEmail, :text => message}
    @recipients = 'email@company.com'
    @from       = 'email@company.com'
    @sent_on    = sent_at
    @headers    = { 'X-contact' => 'Company'}
  end

code for unit testing:
  def test_contact_us
    @expected.from    = 'public@arachnidae.com'
    @expected.to      = 'public@arachnidae.com'
    @expected.header  = { 'X-contact' => 'Arachnidae'}
    @expected.subject = 'Default Subject'
    @expected.body    = read_fixture('contact_us')
    @expected.date    = Time.now

    assert_equal @expected.encoded, Contact.create_contact_us(@expected.date).encoded
  end


remove the "header" line from the top and the expected.header line from below and it tests fine. Add the header line to the top and it fails the assertion, and I haven't been able to find the correct syntax for getting the custom header into "expected." I know it's something simple.

How do I load the custom header into the expected result?