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:
authorDavid Wagner <david@marvid.fr>2016-11-25 20:26:24 +0300
committerDavid Wagner <david@marvid.fr>2016-11-25 21:11:14 +0300
commitde0a7378eb0e08ab532a6ba80550abf9fe9db875 (patch)
treed656ceb7e8ccc63d9c1ebc62ea82b422af5c3bbe /spec/features/help_pages_spec.rb
parentc4ded595ccf520bc30bde90403366ad14ba8b594 (diff)
Check that both '/help' and '/help/' URLs have the same behaviour
The links in the help page may be modified. This new test checks that URLs in this page are absolute and do not depend on the presence of a trailing slash in the URL. Signed-off-by: David Wagner <david@marvid.fr>
Diffstat (limited to 'spec/features/help_pages_spec.rb')
-rw-r--r--spec/features/help_pages_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb
index e2101b333e2..73d03837144 100644
--- a/spec/features/help_pages_spec.rb
+++ b/spec/features/help_pages_spec.rb
@@ -10,4 +10,28 @@ describe 'Help Pages', feature: true do
expect(page).to have_content("ssh-keygen -t rsa -C \"#{@user.email}\"")
end
end
+
+ describe 'Get the main help page' do
+ shared_examples_for 'help page' do
+ it 'prefixes links correctly' do
+ expect(page).to have_selector('div.documentation-index > ul a[href="/help/api/README.md"]')
+ end
+ end
+
+ 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
+ end
end