diff options
Diffstat (limited to 'spec/features/admin/admin_settings_spec.rb')
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index a074bbcff0a..c77605f3869 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -356,16 +356,18 @@ describe 'Admin updates settings' do end it 'Change Help page' do + new_support_url = 'http://example.com/help' + page.within('.as-help-page') do fill_in 'Help page text', with: 'Example text' check 'Hide marketing-related entries from help' - fill_in 'Support page URL', with: 'http://example.com/help' + fill_in 'Support page URL', with: new_support_url click_button 'Save changes' end expect(current_settings.help_page_text).to eq "Example text" expect(current_settings.help_page_hide_commercial_content).to be_truthy - expect(current_settings.help_page_support_url).to eq "http://example.com/help" + expect(current_settings.help_page_support_url).to eq new_support_url expect(page).to have_content "Application settings saved successfully" end @@ -415,6 +417,34 @@ describe 'Admin updates settings' do end end + context 'Nav bar' do + it 'Shows default help links in nav' do + default_support_url = 'https://about.gitlab.com/getting-help/' + + visit root_dashboard_path + + find('.header-help-dropdown-toggle').click + + page.within '.header-help' do + expect(page).to have_link(text: 'Help', href: help_path) + expect(page).to have_link(text: 'Support', href: default_support_url) + end + end + + it 'Shows custom support url in nav when set' do + new_support_url = 'http://example.com/help' + stub_application_setting(help_page_support_url: new_support_url) + + visit root_dashboard_path + + find('.header-help-dropdown-toggle').click + + page.within '.header-help' do + expect(page).to have_link(text: 'Support', href: new_support_url) + end + end + end + def check_all_events page.check('Active') page.check('Push') |