summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 21:07:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 21:07:51 +0000
commitd74fcc9b69746c4d9582299c370a95aafe2ac3ac (patch)
tree8230bdf94ff004521422c9986062278dd3bc5b3f /spec/features
parent8a7efa45c38ed3200d173d2c3207a8154e583c16 (diff)
downloadgitlab-ce-d74fcc9b69746c4d9582299c370a95aafe2ac3ac.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/admin/admin_serverless_domains_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/features/admin/admin_serverless_domains_spec.rb b/spec/features/admin/admin_serverless_domains_spec.rb
index 85fe67004da..48f6af8d4bd 100644
--- a/spec/features/admin/admin_serverless_domains_spec.rb
+++ b/spec/features/admin/admin_serverless_domains_spec.rb
@@ -56,4 +56,32 @@ describe 'Admin Serverless Domains', :js do
expect(page).to have_content 'Domain was successfully updated'
expect(page).to have_content '/CN=test-certificate'
end
+
+ context 'when domain exists' do
+ let!(:domain) { create(:pages_domain, :instance_serverless) }
+
+ it 'Displays a modal when attempting to delete a domain' do
+ visit admin_serverless_domains_path
+
+ click_button 'Delete domain'
+
+ page.within '#modal-delete-domain' do
+ expect(page).to have_content "You are about to delete #{domain.domain} from your instance."
+ expect(page).to have_link('Delete domain')
+ end
+ end
+
+ it 'Displays a modal with disabled button if unable to delete a domain' do
+ create(:serverless_domain_cluster, pages_domain: domain)
+
+ visit admin_serverless_domains_path
+
+ click_button 'Delete domain'
+
+ page.within '#modal-delete-domain' do
+ expect(page).to have_content "You must disassociate #{domain.domain} from all clusters it is attached to before deletion."
+ expect(page).to have_link('Delete domain')
+ end
+ end
+ end
end