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 =, 
                 subjectLine = "Default Subject",
                 senderName = "company",
                 senderEmail = "",
                 message = "empty text" )
    @subject    = subjectLine
    @body       = { :name => senderName, :email => senderEmail, :text => message}
    @recipients = ''
    @from       = ''
    @sent_on    = sent_at
    @headers    = { 'X-contact' => 'Company'}

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

    assert_equal @expected.encoded, Contact.create_contact_us(

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?