expect do
click_on "Send email"
end.to change(ActionMailer::Base.deliveries, :count).by(1)
expect(ActionMailer::Base.deliveries.last.subject).to eq "My email subject"
Feb 14, 2025
expect do
click_on "Send email"
end.to change(ActionMailer::Base.deliveries, :count).by(1)
expect(ActionMailer::Base.deliveries.last.subject).to eq "My email subject"