Skip to content

Commit 56cc56c

Browse files
jamesdabbsbenoittgt
authored andcommitted
Add documentation to new mailbox methods
1 parent 8840963 commit 56cc56c

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

lib/rspec/rails/example/mailbox_example_group.rb

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module MailboxExampleGroup
99
require 'action_mailbox/test_helper'
1010
extend ::ActionMailbox::TestHelper
1111

12+
# @private
1213
def self.create_inbound_email(arg)
1314
case arg
1415
when Hash
@@ -34,27 +35,32 @@ def mailbox_class
3435
subject { described_class }
3536
end
3637

37-
# Verify the status of any inbound email
38+
# @api public
39+
# Passes if the inbound email was delivered
3840
#
3941
# @example
40-
# describe ForwardsMailbox do
41-
# it "can describe what happened to the inbound email" do
42-
# mail = process(args)
43-
#
44-
# # can use any of:
45-
# expect(mail).to have_been_delivered
46-
# expect(mail).to have_bounced
47-
# expect(mail).to have_failed
48-
# end
49-
# end
42+
# inbound_email = process(args)
43+
# expect(inbound_email).to have_been_delivered
5044
def have_been_delivered
5145
satisfy('have been delivered', &:delivered?)
5246
end
5347

48+
# @api public
49+
# Passes if the inbound email bounced during processing
50+
#
51+
# @example
52+
# inbound_email = process(args)
53+
# expect(inbound_email).to have_bounced
5454
def have_bounced
5555
satisfy('have bounced', &:bounced?)
5656
end
5757

58+
# @api public
59+
# Passes if the inbound email failed to process
60+
#
61+
# @example
62+
# inbound_email = process(args)
63+
# expect(inbound_email).to have_failed
5864
def have_failed
5965
satisfy('have failed', &:failed?)
6066
end

0 commit comments

Comments
 (0)