diff options
Diffstat (limited to 'spec/features/help_pages_spec.rb')
-rw-r--r-- | spec/features/help_pages_spec.rb | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb index e24b1f4349d..f5ee7369ee5 100644 --- a/spec/features/help_pages_spec.rb +++ b/spec/features/help_pages_spec.rb @@ -1,96 +1,96 @@ # frozen_string_literal: true -require 'spec_helper' +require "spec_helper" -describe 'Help Pages' do - describe 'Get the main help page' do - shared_examples_for 'help page' do |prefix: ''| - it 'prefixes links correctly' do +describe "Help Pages" do + 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 > table tbody tr td a[href="#{prefix}/help/api/README.md"])) end end - context 'without a trailing slash' do + context "without a trailing slash" do before do visit help_path end - it_behaves_like 'help page' + it_behaves_like "help page" end - context 'with a trailing slash' do + context "with a trailing slash" do before do - visit help_path + '/' + visit help_path + "/" end - it_behaves_like 'help page' + it_behaves_like "help page" end - context 'with a relative installation' do + context "with a relative installation" do before do - stub_config_setting(relative_url_root: '/gitlab') + stub_config_setting(relative_url_root: "/gitlab") visit help_path end - it_behaves_like 'help page', prefix: '/gitlab' + it_behaves_like "help page", prefix: "/gitlab" end - context 'quick link shortcuts', :js do + context "quick link shortcuts", :js do before do visit help_path end - it 'focuses search bar' do - find('.js-trigger-search-bar').click + it "focuses search bar" do + find(".js-trigger-search-bar").click - expect(page).to have_selector('#search:focus') + expect(page).to have_selector("#search:focus") end - it 'opens shortcuts help dialog' do - find('.js-trigger-shortcut').click + it "opens shortcuts help dialog" do + find(".js-trigger-shortcut").click - expect(page).to have_selector('#modal-shortcuts') + expect(page).to have_selector("#modal-shortcuts") end end end - context 'in a production environment with version check enabled' do + context "in a production environment with version check enabled" do before do stub_application_setting(version_check_enabled: true) allow(Rails.env).to receive(:production?).and_return(true) - allow(VersionCheck).to receive(:url).and_return('/version-check-url') + allow(VersionCheck).to receive(:url).and_return("/version-check-url") sign_in(create(:user)) visit help_path end - it 'has a version check image' do + it "has a version check image" do # Check `data-src` due to lazy image loading - expect(find('.js-version-status-badge', visible: false)['data-src']) - .to end_with('/version-check-url') + expect(find(".js-version-status-badge", visible: false)["data-src"]) + .to end_with("/version-check-url") end end - describe 'when help page is customized' do + describe "when help page is customized" do before do stub_application_setting(help_page_hide_commercial_content: true, - help_page_text: 'My Custom Text', - help_page_support_url: 'http://example.com/help') + help_page_text: "My Custom Text", + help_page_support_url: "http://example.com/help") sign_in(create(:user)) visit help_path end - it 'should display custom help page text' do + it "should display custom help page text" do expect(page).to have_text "My Custom Text" end - it 'should hide marketing content when enabled' do + it "should hide marketing content when enabled" do expect(page).not_to have_link "Get a support subscription" end - it 'should use a custom support url' do + it "should use a custom support url" do expect(page).to have_link "See our website for getting help", href: "http://example.com/help" end end |