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:
authorVladimir Shushlin <vshushlin@gitlab.com>2019-04-30 15:05:54 +0300
committerNick Thomas <nick@gitlab.com>2019-04-30 15:05:54 +0300
commitac744fd4fceb996dcafe7958dd35b081331f46fe (patch)
treeeba5a21f6e074b2c83141dda4999034b3b7aec93 /spec/models/pages_domain_spec.rb
parent9e2958aed9fb634801d57acd2bd6f4500dec012e (diff)
Remove disabled pages domains
Domain will be removed by verification worker after 1 week of being disabled
Diffstat (limited to 'spec/models/pages_domain_spec.rb')
-rw-r--r--spec/models/pages_domain_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb
index 142ddebbbf8..ec4d4517f82 100644
--- a/spec/models/pages_domain_spec.rb
+++ b/spec/models/pages_domain_spec.rb
@@ -344,4 +344,32 @@ describe PagesDomain do
end
end
end
+
+ describe '.for_removal' do
+ subject { described_class.for_removal }
+
+ context 'when domain is not schedule for removal' do
+ let!(:domain) { create :pages_domain }
+
+ it 'does not return domain' do
+ is_expected.to be_empty
+ end
+ end
+
+ context 'when domain is scheduled for removal yesterday' do
+ let!(:domain) { create :pages_domain, remove_at: 1.day.ago }
+
+ it 'returns domain' do
+ is_expected.to eq([domain])
+ end
+ end
+
+ context 'when domain is scheduled for removal tomorrow' do
+ let!(:domain) { create :pages_domain, remove_at: 1.day.from_now }
+
+ it 'does not return domain' do
+ is_expected.to be_empty
+ end
+ end
+ end
end