77985826d9
* Add email_header_and_footer_enabled flag to appearances table * Set email_header_and_footer_enabled default value to false * Add checkbox to appearance to toggle show header and footer in emails * Add email_header_and_footer_enabled to allowed params in controller * Add header and footer messages to the html and text email layouts * Remove the color styling for emails header and footer * Add empty_mailer layout for emails without layout, to have the header and footer applied
28 lines
709 B
Ruby
28 lines
709 B
Ruby
require 'rails_helper'
|
|
|
|
describe RepositoryCheckMailer do
|
|
include EmailSpec::Matchers
|
|
|
|
describe '.notify' do
|
|
it 'emails all admins' do
|
|
admins = create_list(:admin, 3)
|
|
|
|
mail = described_class.notify(1)
|
|
|
|
expect(mail).to deliver_to admins.map(&:email)
|
|
end
|
|
|
|
it 'mentions the number of failed checks' do
|
|
mail = described_class.notify(3)
|
|
|
|
expect(mail).to have_subject 'GitLab Admin | 3 projects failed their last repository check'
|
|
end
|
|
|
|
context 'with footer and header' do
|
|
subject { described_class.notify(1) }
|
|
|
|
it_behaves_like 'appearance header and footer enabled'
|
|
it_behaves_like 'appearance header and footer not enabled'
|
|
end
|
|
end
|
|
end
|