summaryrefslogtreecommitdiff
path: root/spec/features/help_pages_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-18 23:39:51 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-18 23:39:51 +0100
commit14d47884dff6844625c2e65b247fd773d78f5ea2 (patch)
tree10fba027e61521df236fd6eec7ba829c5fe2c8ec /spec/features/help_pages_spec.rb
parent9fd775def2d89500cf291fe675458b68ead7cd2c (diff)
parent546fa165ff728bc2d25ed9b55b95dd1d48139d4a (diff)
downloadgitlab-ce-dockerfile-templates.tar.gz
Merge remote-tracking branch 'origin/master' into dockerfile-templatesdockerfile-templates
Diffstat (limited to 'spec/features/help_pages_spec.rb')
-rw-r--r--spec/features/help_pages_spec.rb35
1 files changed, 29 insertions, 6 deletions
diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb
index e2101b333e2..40a1fced8d8 100644
--- a/spec/features/help_pages_spec.rb
+++ b/spec/features/help_pages_spec.rb
@@ -1,13 +1,36 @@
require 'spec_helper'
describe 'Help Pages', feature: true do
- describe 'Show SSH page' do
- before do
- login_as :user
+ describe 'Get the main help page' do
+ shared_examples_for 'help page' do |prefix: ''|
+ it 'prefixes links correctly' do
+ expect(page).to have_selector(%(div.documentation-index > ul a[href="#{prefix}/help/api/README.md"]))
+ end
end
- it 'replaces the variable $your_email with the email of the user' do
- visit help_page_path('ssh/README')
- expect(page).to have_content("ssh-keygen -t rsa -C \"#{@user.email}\"")
+
+ context 'without a trailing slash' do
+ before do
+ visit help_path
+ end
+
+ it_behaves_like 'help page'
+ end
+
+ context 'with a trailing slash' do
+ before do
+ visit help_path + '/'
+ end
+
+ it_behaves_like 'help page'
+ end
+
+ context 'with a relative installation' do
+ before do
+ stub_config_setting(relative_url_root: '/gitlab')
+ visit help_path
+ end
+
+ it_behaves_like 'help page', prefix: '/gitlab'
end
end
end