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>2023-10-19 15:57:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-19 15:57:54 +0300
commit419c53ec62de6e97a517abd5fdd4cbde3a942a34 (patch)
tree1f43a548b46bca8a5fb8fe0c31cef1883d49c5b6 /spec/migrations/20230913071219_delete_pages_domain_with_reserved_domains_spec.rb
parent1da20d9135b3ad9e75e65b028bffc921aaf8deb7 (diff)
Add latest changes from gitlab-org/gitlab@16-5-stable-eev16.5.0-rc42
Diffstat (limited to 'spec/migrations/20230913071219_delete_pages_domain_with_reserved_domains_spec.rb')
-rw-r--r--spec/migrations/20230913071219_delete_pages_domain_with_reserved_domains_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/migrations/20230913071219_delete_pages_domain_with_reserved_domains_spec.rb b/spec/migrations/20230913071219_delete_pages_domain_with_reserved_domains_spec.rb
new file mode 100644
index 00000000000..a70bed53615
--- /dev/null
+++ b/spec/migrations/20230913071219_delete_pages_domain_with_reserved_domains_spec.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!
+
+RSpec.describe DeletePagesDomainWithReservedDomains, feature_category: :pages do
+ describe 'migrates' do
+ context 'when a reserved domain is provided' do
+ it 'delete the domain' do
+ table(:pages_domains).create!(domain: 'gmail.com', verification_code: 'gmail')
+ expect { migrate! }.to change { PagesDomain.count }.by(-1)
+ end
+ end
+
+ context 'when a reserved domain is provided with non standard case' do
+ it 'delete the domain' do
+ table(:pages_domains).create!(domain: 'AOl.com', verification_code: 'aol')
+ expect { migrate! }.to change { PagesDomain.count }.by(-1)
+ end
+ end
+
+ context 'when a non reserved domain is provided' do
+ it 'does not delete the domain' do
+ table(:pages_domains).create!(domain: 'example.com', verification_code: 'example')
+ expect { migrate! }.not_to change { PagesDomain.count }
+ expect(table(:pages_domains).find_by(domain: 'example.com')).not_to be_nil
+ end
+ end
+ end
+end