Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mailers/devise_mailer_spec.rb')
-rw-r--r--spec/mailers/devise_mailer_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/mailers/devise_mailer_spec.rb b/spec/mailers/devise_mailer_spec.rb
index 2ee15308400..c9dfee8255d 100644
--- a/spec/mailers/devise_mailer_spec.rb
+++ b/spec/mailers/devise_mailer_spec.rb
@@ -64,4 +64,34 @@ RSpec.describe DeviseMailer do
is_expected.to have_body_text /#{Gitlab.config.gitlab.url}/
end
end
+
+ describe '#user_admin_approval' do
+ subject { described_class.user_admin_approval(user) }
+
+ let_it_be(:user) { create(:user) }
+
+ it_behaves_like 'an email sent from GitLab'
+ it_behaves_like 'it should not have Gmail Actions links'
+ it_behaves_like 'a user cannot unsubscribe through footer link'
+
+ it 'is sent to the user' do
+ is_expected.to deliver_to user.email
+ end
+
+ it 'has the correct subject' do
+ is_expected.to have_subject 'Welcome to GitLab!'
+ end
+
+ it 'greets the user' do
+ is_expected.to have_body_text /Hi #{user.name}!/
+ end
+
+ it 'includes the correct content' do
+ is_expected.to have_body_text /Your GitLab account request has been approved!/
+ end
+
+ it 'includes a link to GitLab' do
+ is_expected.to have_link(Gitlab.config.gitlab.url)
+ end
+ end
end