mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 16:16:43 +10:00
32 lines
1.0 KiB
Ruby
32 lines
1.0 KiB
Ruby
class Spinach::Features::AdminEmail < Spinach::FeatureSteps
|
|
include SharedAuthentication
|
|
include SharedPaths
|
|
include SharedAdmin
|
|
|
|
step 'I submit form with email notification info' do
|
|
ActionMailer::Base.deliveries = []
|
|
@email_text = "Your project has been moved."
|
|
@selected_group = Group.last
|
|
# ensure there are ppl to be emailed
|
|
2.times do
|
|
@selected_group.add_user(create(:user), Gitlab::Access::DEVELOPER)
|
|
end
|
|
|
|
within('form#new-admin-email') do
|
|
fill_in :subject, with: 'my subject'
|
|
fill_in :body, with: @email_text
|
|
select @selected_group.name, from: :recipients
|
|
find('.btn-create').click
|
|
end
|
|
end
|
|
|
|
step 'I should see a notification email is begin sent' do
|
|
expect(find('.flash-notice')).to have_content 'Email sent'
|
|
end
|
|
|
|
step 'admin emails are being sent' do
|
|
expect(ActionMailer::Base.deliveries.count).to eql @selected_group.users.count
|
|
mail = ActionMailer::Base.deliveries.last
|
|
expect(mail.text_part.body.decoded).to include @email_text
|
|
end
|
|
end |