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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 18:09:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 18:09:44 +0300
commit874ead9c3a50de4c4ca4551eaf5b7eb976d26b50 (patch)
tree637ee9f2da5e251bc08ebf3e972209d51966bf7c /spec/mailers
parent2e4c4055181eec9186458dd5dd3219c937032ec7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/emails/pages_domains_spec.rb31
1 files changed, 23 insertions, 8 deletions
diff --git a/spec/mailers/emails/pages_domains_spec.rb b/spec/mailers/emails/pages_domains_spec.rb
index 78887cef7ab..5029a17e4e5 100644
--- a/spec/mailers/emails/pages_domains_spec.rb
+++ b/spec/mailers/emails/pages_domains_spec.rb
@@ -23,13 +23,20 @@ describe Emails::PagesDomains do
is_expected.to have_subject(email_subject)
is_expected.to have_body_text(project.human_name)
is_expected.to have_body_text(domain.domain)
- is_expected.to have_body_text domain.url
is_expected.to have_body_text project_pages_domain_url(project, domain)
- is_expected.to have_body_text help_page_url('user/project/pages/custom_domains_ssl_tls_certification/index.md', anchor: link_anchor)
end
end
end
+ shared_examples 'a pages domain verification email' do
+ it_behaves_like 'a pages domain email'
+
+ it 'has the expected content' do
+ is_expected.to have_body_text domain.url
+ is_expected.to have_body_text help_page_url('user/project/pages/custom_domains_ssl_tls_certification/index.md', anchor: link_anchor)
+ end
+ end
+
shared_examples 'notification about upcoming domain removal' do
context 'when domain is not scheduled for removal' do
it 'asks user to remove it' do
@@ -56,7 +63,7 @@ describe Emails::PagesDomains do
subject { Notify.pages_domain_enabled_email(domain, user) }
- it_behaves_like 'a pages domain email'
+ it_behaves_like 'a pages domain verification email'
it { is_expected.to have_body_text 'has been enabled' }
end
@@ -67,7 +74,7 @@ describe Emails::PagesDomains do
subject { Notify.pages_domain_disabled_email(domain, user) }
- it_behaves_like 'a pages domain email'
+ it_behaves_like 'a pages domain verification email'
it_behaves_like 'notification about upcoming domain removal'
@@ -80,7 +87,7 @@ describe Emails::PagesDomains do
subject { Notify.pages_domain_verification_succeeded_email(domain, user) }
- it_behaves_like 'a pages domain email'
+ it_behaves_like 'a pages domain verification email'
it { is_expected.to have_body_text 'successfully verified' }
end
@@ -94,10 +101,18 @@ describe Emails::PagesDomains do
it_behaves_like 'a pages domain email'
it_behaves_like 'notification about upcoming domain removal'
+ end
+
+ describe '#pages_domain_auto_ssl_failed_email' do
+ let(:email_subject) { "#{project.path} | ACTION REQUIRED: Something went wrong while obtaining the Let's Encrypt certificate for GitLab Pages domain '#{domain.domain}'" }
+
+ subject { Notify.pages_domain_auto_ssl_failed_email(domain, user) }
+
+ it_behaves_like 'a pages domain email'
- it 'says verification has failed and when the domain is enabled until' do
- is_expected.to have_body_text 'Verification has failed'
- is_expected.to have_body_text domain.enabled_until.strftime('%F %T')
+ it 'says that we failed to obtain certificate' do
+ is_expected.to have_body_text "Something went wrong while obtaining the Let's Encrypt certificate."
+ is_expected.to have_body_text help_page_url('user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md', anchor: 'troubleshooting')
end
end
end