Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6545151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:33:07+00:00 2026-05-25T11:33:07+00:00

I have a message object, @mail and I’d like to test that the from

  • 0

I have a message object, @mail and I’d like to test that the “from” name includes a string:

@mail.from.should include @author.name

however, @mail.from is simply an array of the addresses the mail is to be sent to, there’s no mention of what label the addresses should be given.

How can I access the “from” label so that I can test it includes the author’s name?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:33:07+00:00Added an answer on May 25, 2026 at 11:33 am

    You can use email-spec gem for this.
    Some test example from my app

      include EmailSpec::Helpers
      include EmailSpec::Matchers
    
      describe "admin details" do
        before { @admin = Factory :admin }
        subject { Mailer.admin_profile_details @admin }
        it { should deliver_to @admin.email }
        it { should have_subject 'Your account' }
        it { should have_body_text /email/i }
      end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application that uses the CDO Message object to email reports.
I have a message handler, which consumes from a JMS queue and that sends
Problem Normal objects serialize to something like: --- !ruby/object {}\n\n whereas Mail::Message serialize to:
If I have a mail object, eg: mail = Mail.new do from jim@gmail.com to
I have a JUnit4 test which extends AbstractTransactionalJUnit4SpringContextTests. I have a business object that
I have a message that I want to fadeIn when a form is successfully
I have a simple message box in a WPF application that is launched as
I have a function that sends email using asp.net built in mail framework. I've
I'm writing a message processing application (email) that I want to have an outgoing
So I have this class that starts like this: class emailreader(): def __init__(self, server,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.