gitlab-org--gitlab-foss/spec/mailers/repository_check_mailer_spe...

22 lines
489 B
Ruby
Raw Normal View History

2016-04-04 15:23:43 +00:00
require 'rails_helper'
2016-04-06 11:47:05 +00:00
describe RepositoryCheckMailer do
2016-04-04 15:23:43 +00:00
include EmailSpec::Matchers
describe '.notify' do
it 'emails all admins' do
2016-04-14 15:05:41 +00:00
admins = create_list(:admin, 3)
2016-04-04 15:23:43 +00:00
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)
2016-04-18 08:58:40 +00:00
expect(mail).to have_subject 'GitLab Admin | 3 projects failed their last repository check'
2016-04-04 15:23:43 +00:00
end
end
end