Skip to content

Commit ecbacb5

Browse files
committed
Addressing feedback
1 parent 160a517 commit ecbacb5

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

features/matchers/send_email_matcher.feature

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Feature: `send_email` matcher
22

3-
The `send_email` matcher is used to check if an email with the given parameters has been sent during a spec example run.
3+
The `send_email` matcher is used to check if an email with the given parameters has been sent inside the expectation block.
44

55
NOTE: It implies that the spec example actually sends the email using the test adapter and does not schedule it for background.
66

@@ -66,21 +66,3 @@ Feature: `send_email` matcher
6666
"""
6767
When I run `rspec spec/mailers/notifications_mailer_spec.rb`
6868
Then the examples should all pass
69-
70-
Scenario: Checking email sent with a wrong parameter
71-
Given a file named "spec/mailers/notifications_mailer_spec.rb" with:
72-
"""ruby
73-
require "rails_helper"
74-
75-
RSpec.describe NotificationsMailer do
76-
it "checks email not sent" do
77-
expect {
78-
NotificationsMailer.signup.deliver_now
79-
}.to send_email(
80-
81-
)
82-
end
83-
end
84-
"""
85-
When I run `rspec spec/mailers/notifications_mailer_spec.rb`
86-
Then the examples should fail

lib/rspec/rails/matchers/send_email.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def multiple_match?
9191

9292
def sent_emails_message
9393
if @diff.empty?
94-
"\n\nNo emails were sent."
94+
"\n\nThere were no any emails sent inside the expectation block."
9595
else
9696
sent_emails =
9797
@diff.map do |email|

spec/rspec/rails/matchers/send_email_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_email
6060
}.to raise_error(RSpec::Expectations::ExpectationNotMetError, <<~MSG.strip)
6161
No matching emails were sent.
6262
63-
No emails were sent.
63+
There were no any emails sent inside the expectation block.
6464
MSG
6565
end
6666

0 commit comments

Comments
 (0)