diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-06-14 17:16:50 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-06-14 17:16:50 +0000 |
commit | 6bdfeff6e7bbd0584167096c2f868348d6291c69 (patch) | |
tree | 93b3b820084207ca1c85f365ccb029189d8ad823 /spec/features | |
parent | 5771b946c2e68fd4b9a8ff040c168b568b68a586 (diff) | |
parent | e09ddc62b32256baa3a0676e0fd68b38e72cafcd (diff) | |
download | gitlab-ce-6bdfeff6e7bbd0584167096c2f868348d6291c69.tar.gz |
Merge branch 'help-landing-page-customizations' into 'master'
Allow more customization to Help landing page
See merge request !11878
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/admin/admin_settings_spec.rb | 5 | ||||
-rw-r--r-- | spec/features/help_pages_spec.rb | 25 |
2 files changed, 29 insertions, 1 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 5099441dce2..27bc25be580 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -20,10 +20,15 @@ feature 'Admin updates settings', feature: true do uncheck 'Gravatar enabled' fill_in 'Home page URL', with: 'https://about.gitlab.com/' 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' click_button 'Save' expect(current_application_settings.gravatar_enabled).to be_falsey expect(current_application_settings.home_page_url).to eq "https://about.gitlab.com/" + expect(current_application_settings.help_page_text).to eq "Example text" + expect(current_application_settings.help_page_hide_commercial_content).to be_truthy + expect(current_application_settings.help_page_support_url).to eq "http://example.com/help" expect(page).to have_content "Application settings saved successfully" end diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb index 31014f5cad2..18102146b5f 100644 --- a/spec/features/help_pages_spec.rb +++ b/spec/features/help_pages_spec.rb @@ -37,7 +37,7 @@ describe 'Help Pages', feature: true do context 'in a production environment with version check enabled', :js do before do allow(Rails.env).to receive(:production?) { true } - allow(current_application_settings).to receive(:version_check_enabled) { true } + allow_any_instance_of(ApplicationSetting).to receive(:version_check_enabled) { true } allow_any_instance_of(VersionCheck).to receive(:url) { '/version-check-url' } login_as :user @@ -53,4 +53,27 @@ describe 'Help Pages', feature: true do expect(find('.js-version-status-badge', visible: false)).not_to be_visible end end + + describe 'when help page is customized' do + before do + allow_any_instance_of(ApplicationSetting).to receive(:help_page_hide_commercial_content?) { true } + allow_any_instance_of(ApplicationSetting).to receive(:help_page_text) { "My Custom Text" } + allow_any_instance_of(ApplicationSetting).to receive(:help_page_support_url) { "http://example.com/help" } + + login_as :user + visit help_path + end + + 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 + expect(page).not_to have_link "Get a support subscription" + end + + 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 end |