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
|
|
|
|
describe 'Show SSH page' do
|
2015-01-15 20:06:32 -05:00
|
|
|
before do
|
|
|
|
login_as :user
|
|
|
|
end
|
2016-07-25 14:16:19 -04:00
|
|
|
it 'replaces the variable $your_email with the email of the user' do
|
2016-05-16 18:06:26 -04:00
|
|
|
visit help_page_path('ssh/README')
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(page).to have_content("ssh-keygen -t rsa -C \"#{@user.email}\"")
|
2015-01-15 20:06:32 -05:00
|
|
|
end
|
|
|
|
end
|
2016-11-25 12:26:24 -05:00
|
|
|
|
|
|
|
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
|
2015-01-15 20:06:32 -05:00
|
|
|
end
|