summaryrefslogtreecommitdiff
path: root/spec/features/projects/pages_spec.rb
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-02-28 15:40:52 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-02-28 15:40:52 +0000
commitb5b8dc83cc1bb271877c79532ecfb555540672a7 (patch)
tree190f6cd6991cbfbabbd670a7aac5ff36eb1a64bb /spec/features/projects/pages_spec.rb
parentdeef09cd1f0dbe5cab5095ff02f19a5c3588cb91 (diff)
parentff2f57da791890957fe97efd46f5c34f270a0c46 (diff)
downloadgitlab-ce-dispatcher-cycle-analytics.tar.gz
Merge branch 'master' into 'dispatcher-cycle-analytics'dispatcher-cycle-analytics
# Conflicts: # config/webpack.config.js
Diffstat (limited to 'spec/features/projects/pages_spec.rb')
-rw-r--r--spec/features/projects/pages_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/features/projects/pages_spec.rb b/spec/features/projects/pages_spec.rb
index a96f2c186a4..2a0d235ef04 100644
--- a/spec/features/projects/pages_spec.rb
+++ b/spec/features/projects/pages_spec.rb
@@ -160,6 +160,37 @@ feature 'Pages' do
expect(page).to have_content('my.test.domain.com')
end
+
+ describe 'updating the certificate for an existing domain' do
+ let!(:domain) do
+ create(:pages_domain, :with_key, :with_certificate, project: project)
+ end
+
+ it 'allows the certificate to be updated' do
+ visit project_pages_path(project)
+
+ within('#content-body') { click_link 'Details' }
+ click_link 'Edit'
+ click_button 'Save Changes'
+
+ expect(page).to have_content('Domain was updated')
+ end
+
+ context 'when the certificate is invalid' do
+ it 'tells the user what the problem is' do
+ visit project_pages_path(project)
+
+ within('#content-body') { click_link 'Details' }
+ click_link 'Edit'
+ fill_in 'Certificate (PEM)', with: 'invalid data'
+ click_button 'Save Changes'
+
+ expect(page).to have_content('Certificate must be a valid PEM certificate')
+ expect(page).to have_content('Certificate misses intermediates')
+ expect(page).to have_content("Key doesn't match the certificate")
+ end
+ end
+ end
end
end