mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
d0801dd060
It is defined by SaaS to use the reply_token, which fails otherwise
32 lines
879 B
Ruby
32 lines
879 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.shared_examples_for "mail is sent" do
|
|
let(:letters_sent_count) { 1 }
|
|
let(:mail) { deliveries.first }
|
|
let(:html_body) { mail.body.parts.detect { |p| p.content_type.include? "text/html" }.body.encoded }
|
|
|
|
it "actually sends a mail" do
|
|
expect(deliveries.size).to eql(letters_sent_count)
|
|
end
|
|
|
|
it "is sent to the recipient" do
|
|
expect(deliveries.first.to).to include(recipient.mail)
|
|
end
|
|
|
|
it "is sent from the configured address" do
|
|
expect(deliveries.first.from).to contain_exactly(ApplicationMailer.mail_from)
|
|
end
|
|
end
|
|
|
|
RSpec.shared_examples_for "multiple mails are sent" do |set_letters_sent_count|
|
|
it_behaves_like "mail is sent" do
|
|
let(:letters_sent_count) { set_letters_sent_count }
|
|
end
|
|
end
|
|
|
|
RSpec.shared_examples_for "mail is not sent" do
|
|
it "sends no mail" do
|
|
expect(deliveries).to be_empty
|
|
end
|
|
end
|