Help us understand the problem. What is going on with this article?

Ruby・Rails 戻り値を把握する

ActionMailerの場合

sample_mailer_spec.rb
it "〇〇であること" do
  binding.pry
  SampleMailer.sample_survey(self).deliver_now
end

deliver_nowが成功した場合、下記のような戻り値となる

=> #
<Mail::Message:, Multipart: true, Headers: <Date: Wed, 30 Jan 2019 06:55:43 +0000>,
<From: >, 
<To: >, 
<Message-ID: <>>, 
<Subject: >, 
<Mime-Version: 1.0>, 
<Content-Type: multipart/alternative; boundary=""; charset=UTF-8>, 
<Content-Transfer-Encoding: 7bit>>

失敗した場合は、こう

# => nil
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away