diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-18 00:09:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-18 00:09:20 +0000 |
commit | 72721699f11187199e89631ce0b5e3d2f7c167e9 (patch) | |
tree | b51a227be89d82aa24fc954e7b50e7b0933583cc /spec/features | |
parent | 06be418a7cd98a1c87c41ba43cca1ce9acbe885e (diff) | |
download | gitlab-ce-72721699f11187199e89631ce0b5e3d2f7c167e9.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.rb | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/spec/features/admin/admin_serverless_domains_spec.rb b/spec/features/admin/admin_serverless_domains_spec.rb new file mode 100644 index 00000000000..85fe67004da --- /dev/null +++ b/spec/features/admin/admin_serverless_domains_spec.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Admin Serverless Domains', :js do + let(:sample_domain) { build(:pages_domain) } + + before do + allow(Gitlab.config.pages).to receive(:enabled).and_return(true) + sign_in(create(:admin)) + end + + it 'Add domain with certificate' do + visit admin_serverless_domains_path + + fill_in 'pages_domain[domain]', with: 'foo.com' + fill_in 'pages_domain[user_provided_certificate]', with: sample_domain.certificate + fill_in 'pages_domain[user_provided_key]', with: sample_domain.key + click_button 'Add domain' + + expect(current_path).to eq admin_serverless_domains_path + + expect(page).to have_field('pages_domain[domain]', with: 'foo.com') + expect(page).to have_field('serverless_domain_dns', with: /^\*\.foo\.com CNAME /) + expect(page).to have_field('serverless_domain_verification', with: /^_gitlab-pages-verification-code.foo.com TXT /) + expect(page).not_to have_field('pages_domain[user_provided_certificate]') + expect(page).not_to have_field('pages_domain[user_provided_key]') + + expect(page).to have_content 'Unverified' + expect(page).to have_content '/CN=test-certificate' + end + + it 'Update domain certificate' do + visit admin_serverless_domains_path + + fill_in 'pages_domain[domain]', with: 'foo.com' + fill_in 'pages_domain[user_provided_certificate]', with: sample_domain.certificate + fill_in 'pages_domain[user_provided_key]', with: sample_domain.key + click_button 'Add domain' + + expect(current_path).to eq admin_serverless_domains_path + + expect(page).not_to have_field('pages_domain[user_provided_certificate]') + expect(page).not_to have_field('pages_domain[user_provided_key]') + + click_button 'Replace' + + expect(page).to have_field('pages_domain[user_provided_certificate]') + expect(page).to have_field('pages_domain[user_provided_key]') + + fill_in 'pages_domain[user_provided_certificate]', with: sample_domain.certificate + fill_in 'pages_domain[user_provided_key]', with: sample_domain.key + + click_button 'Save changes' + + expect(page).to have_content 'Domain was successfully updated' + expect(page).to have_content '/CN=test-certificate' + end +end |