2015-01-15 20:06:32 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-01-18 11:21:18 -05:00
|
|
|
describe 'Help Pages', feature: true do
|
2016-11-25 12:26:24 -05:00
|
|
|
describe 'Get the main help page' do
|
2016-12-01 06:07:52 -05:00
|
|
|
shared_examples_for 'help page' do |prefix: ''|
|
2016-11-25 12:26:24 -05:00
|
|
|
it 'prefixes links correctly' do
|
2016-12-01 06:07:52 -05:00
|
|
|
expect(page).to have_selector(%(div.documentation-index > ul a[href="#{prefix}/help/api/README.md"]))
|
2016-11-25 12:26:24 -05:00
|
|
|
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
|
2016-12-01 06:07:52 -05:00
|
|
|
|
|
|
|
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
|
2016-11-25 12:26:24 -05:00
|
|
|
end
|
2015-01-15 20:06:32 -05:00
|
|
|
end
|