Skip to content

Commit e886b55

Browse files
authored
Merge pull request #2295 from rspec/reword-specs
Reword mailer specs doc strings for ensuring deliveries are cleared
2 parents d7348b8 + 7729af6 commit e886b55

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/rspec/rails/configuration_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ def self.application; end
257257
expect(group.new).to be_a(RSpec::Rails::MailerExampleGroup)
258258
end
259259

260-
describe 'leans test mailbox after each example' do
261-
let(:base_mailer) do
260+
describe 'clears ActionMailer::Base::Deliveries after each example' do
261+
let(:mailer) do
262262
Class.new(ActionMailer::Base) do
263263
default from: '[email protected]'
264264

@@ -272,14 +272,14 @@ def welcome(to:)
272272
ActionMailer::Base.delivery_method = :test
273273
end
274274

275-
it 'send to email@' do
276-
base_mailer.welcome(to: '[email protected]').deliver_now
275+
it 'only has deliveries from this test (e.g. from email@example.com)' do
276+
mailer.welcome(to: '[email protected]').deliver_now
277277

278278
expect(ActionMailer::Base.deliveries.map(&:to).flatten.sort).to eq(['[email protected]'])
279279
end
280280

281-
it 'send to email_2@' do
282-
base_mailer.welcome(to: '[email protected]').deliver_now
281+
it 'only has deliveries from this test (e.g. from email_2@example.com)' do
282+
mailer.welcome(to: '[email protected]').deliver_now
283283

284284
expect(ActionMailer::Base.deliveries.map(&:to).flatten.sort).to eq(['[email protected]'])
285285
end

0 commit comments

Comments
 (0)