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-15 00:09:52 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-15 00:09:52 +0300
commitae93b284016c07a8a4b47e2510789253d14870f3 (patch)
treec7dc8690b841dd7d3a4eeeca944969d14df582a6 /spec/models
parentf697dc5e76dfc5894df006d53b2b7e751653cf05 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/pages_domain_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb
index 4bf56e7b28b..fa2648979e9 100644
--- a/spec/models/pages_domain_spec.rb
+++ b/spec/models/pages_domain_spec.rb
@@ -536,6 +536,24 @@ describe PagesDomain do
'user_provided', 'gitlab_provided')
end
+ describe '#save' do
+ context 'when we failed to obtain ssl certificate' do
+ let(:domain) { create(:pages_domain, auto_ssl_enabled: true, auto_ssl_failed: true) }
+
+ it 'clears failure if auto ssl is disabled' do
+ expect do
+ domain.update!(auto_ssl_enabled: false)
+ end.to change { domain.auto_ssl_failed }.from(true).to(false)
+ end
+
+ it 'does not clear failure on unrelated updates' do
+ expect do
+ domain.update!(verified_at: Time.now)
+ end.not_to change { domain.auto_ssl_failed }.from(true)
+ end
+ end
+ end
+
describe '.for_removal' do
subject { described_class.for_removal }