Commit 1cedb274 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'feat/whats-new-application-setting' into 'master'

Add application setting for What's new [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!59011
parents 483398d3 09a50305
......@@ -5,6 +5,7 @@ class WhatsNewController < ApplicationController
skip_before_action :authenticate_user!
before_action :check_whats_new_enabled
before_action :check_valid_page_param, :set_pagination_headers
feature_category :navigation
......@@ -19,6 +20,10 @@ class WhatsNewController < ApplicationController
private
def check_whats_new_enabled
render_404 if Gitlab::CurrentSettings.current_application_settings.whats_new_variant_disabled?
end
def check_valid_page_param
render_404 if current_page < 1
end
......
......@@ -364,7 +364,8 @@ module ApplicationSettingsHelper
:rate_limiting_response_text,
:container_registry_expiration_policies_worker_capacity,
:container_registry_cleanup_tags_service_max_list_size,
:keep_latest_artifact
:keep_latest_artifact,
:whats_new_variant
]
end
......
......@@ -10,6 +10,33 @@ module WhatsNewHelper
end
def display_whats_new?
Gitlab.dev_env_org_or_com? || user_signed_in?
(Gitlab.dev_env_org_or_com? || user_signed_in?) &&
!Gitlab::CurrentSettings.current_application_settings.whats_new_variant_disabled?
end
def whats_new_variants
ApplicationSetting.whats_new_variants
end
def whats_new_variants_label(variant)
case variant
when 'all_tiers'
_("Enable What's new: All tiers")
when 'current_tier'
_("Enable What's new: Current tier only")
when 'disabled'
_("Disable What's new")
end
end
def whats_new_variants_description(variant)
case variant
when 'all_tiers'
_("What's new presents new features from all tiers to help you keep track of all new features.")
when 'current_tier'
_("What's new presents new features for your current subscription tier, while hiding new features not available to your subscription tier.")
when 'disabled'
_("What's new is disabled and can no longer be viewed.")
end
end
end
......@@ -13,6 +13,8 @@ class ApplicationSetting < ApplicationRecord
KROKI_URL_ERROR_MESSAGE = 'Please check your Kroki URL setting in ' \
'Admin Area > Settings > General > Kroki'
enum whats_new_variant: { all_tiers: 0, current_tier: 1, disabled: 2 }, _prefix: true
add_authentication_token_field :runners_registration_token, encrypted: -> { Feature.enabled?(:application_settings_tokens_optional_encryption) ? :optional : :required }
add_authentication_token_field :health_check_access_token
add_authentication_token_field :static_objects_external_storage_auth_token
......@@ -491,6 +493,9 @@ class ApplicationSetting < ApplicationRecord
allow_nil: true,
numericality: { only_integer: true, greater_than: 0 }
validates :whats_new_variant,
inclusion: { in: ApplicationSetting.whats_new_variants.keys }
attr_encrypted :asset_proxy_secret_key,
mode: :per_attribute_iv,
key: Settings.attr_encrypted_db_key_base_truncated,
......
......@@ -187,7 +187,8 @@ module ApplicationSettingImplementation
kroki_enabled: false,
kroki_url: nil,
kroki_formats: { blockdiag: false, bpmn: false, excalidraw: false },
rate_limiting_response_text: nil
rate_limiting_response_text: nil,
whats_new_variant: 0
}
end
......
......@@ -4,6 +4,10 @@ class ReleaseHighlight
CACHE_DURATION = 1.hour
FILES_PATH = Rails.root.join('data', 'whats_new', '*.yml')
FREE_PACKAGE = 'Free'
PREMIUM_PACKAGE = 'Premium'
ULTIMATE_PACKAGE = 'Ultimate'
def self.paginated(page: 1)
key = self.cache_key("items:page-#{page}")
......@@ -25,10 +29,8 @@ class ReleaseHighlight
file = File.read(file_path)
items = YAML.safe_load(file, permitted_classes: [Date])
platform = Gitlab.com? ? 'gitlab-com' : 'self-managed'
items&.map! do |item|
next unless item[platform]
next unless include_item?(item)
begin
item.tap {|i| i['body'] = Kramdown::Document.new(i['body']).to_html }
......@@ -53,7 +55,8 @@ class ReleaseHighlight
end
def self.cache_key(key)
['release_highlight', key, Gitlab.revision].join(':')
variant = Gitlab::CurrentSettings.current_application_settings.whats_new_variant
['release_highlight', variant, key, Gitlab.revision].join(':')
end
def self.next_page(current_page: 1)
......@@ -88,4 +91,27 @@ class ReleaseHighlight
delegate :each, to: :items
end
def self.current_package
return FREE_PACKAGE unless defined?(License)
case License.current&.plan&.downcase
when License::PREMIUM_PLAN
PREMIUM_PACKAGE
when License::ULTIMATE_PLAN
ULTIMATE_PACKAGE
else
FREE_PACKAGE
end
end
def self.include_item?(item)
platform = Gitlab.com? ? 'gitlab-com' : 'self-managed'
return false unless item[platform]
return true unless Gitlab::CurrentSettings.current_application_settings.whats_new_variant_current_tier?
item['packages']&.include?(current_package)
end
end
= form_for @application_setting, url: preferences_admin_application_settings_path(anchor: 'js-whats-new-settings'), html: { class: 'fieldset-form whats-new-settings' } do |f|
= form_errors(@application_setting)
- whats_new_variants.keys.each do |variant|
.form-check.gl-mb-4
= f.radio_button :whats_new_variant, variant, class: 'form-check-input'
= f.label :whats_new_variant, value: variant, class: 'form-check-label' do
.font-weight-bold
= whats_new_variants_label(variant)
.option-description
= whats_new_variants_description(variant)
= f.submit _('Save changes'), class: "gl-button btn btn-confirm"
......@@ -13,6 +13,17 @@
.settings-content
= render 'email'
%section.settings.as-whats-new-page.no-animate#js-whats-new-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header
%h4
= _("What's new")
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
= expanded_by_default? ? _('Collapse') : _('Expand')
%p
= _("Configure What's new drawer and content.")
.settings-content
= render 'whats_new'
%section.settings.as-help-page.no-animate#js-help-settings{ class: ('expanded' if expanded_by_default?) }
.settings-header
%h4
......
---
title: Add application setting for What's new
merge_request: 59011
author: Jonas Wälter @wwwjon
type: added
# frozen_string_literal: true
class AddWhatsNewApplicationSetting < ActiveRecord::Migration[6.0]
def change
add_column :application_settings, :whats_new_variant, :integer, limit: 2, default: 0
end
end
0ae4e5224aeb0c0a78f3730b7c83505946d3aa40680b64fa2f89370ccefdfd45
\ No newline at end of file
......@@ -9501,6 +9501,7 @@ CREATE TABLE application_settings (
throttle_unauthenticated_packages_api_enabled boolean DEFAULT false NOT NULL,
throttle_authenticated_packages_api_enabled boolean DEFAULT false NOT NULL,
deactivate_dormant_users boolean DEFAULT false NOT NULL,
whats_new_variant smallint DEFAULT 0,
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)),
CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)),
......@@ -19,11 +19,23 @@ feature list, the feature list is tailored to your subscription type:
- Features only available to self-managed installations are not shown on GitLab.com.
- Features only available on GitLab.com are not shown to self-managed installations.
The **What's new** feature cannot be disabled, but
[is planned](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59011) for a future release.
## Self-managed installations
Due to our release post process, the content for **What's new** is not yet finalized
when a new version (`.0` release) is cut. The updated **What's new** is included
in the first patch release, such as `13.10.1`.
## Configure What's new variant
You can configure the What's new variant:
1. Navigate to **Admin Area > Settings > Preferences**, then expand **What's new**.
1. Choose one of the following options:
| Option | Description |
| ------ | ----------- |
| Enable What's new: All tiers | What's new presents new features from all tiers to help you keep track of all new features. |
| Enable What's new: Current tier only | What's new presents new features for your current subscription tier, while hiding new features not available to your subscription tier. |
| Disable What's new | What's new is disabled and can no longer be viewed. |
1. Save your changes.
......@@ -410,6 +410,7 @@ listed in the descriptions of the relevant settings.
| `user_oauth_applications` | boolean | no | Allow users to register any application to use GitLab as an OAuth provider. |
| `user_show_add_ssh_key_message` | boolean | no | When set to `false` disable the "You won't be able to pull or push project code via SSH" warning shown to users with no uploaded SSH key. |
| `version_check_enabled` | boolean | no | Let GitLab inform you when an update is available. |
| `whats_new_variant` | string | no | What's new variant, possible values: `all_tiers`, `current_tier`, and `disabled`. |
| `web_ide_clientside_preview_enabled` | boolean | no | Live Preview (allow live previews of JavaScript projects in the Web IDE using CodeSandbox Live Preview). |
| `wiki_page_max_content_bytes` | integer | no | Maximum wiki page content size in **bytes**. Default: 52428800 Bytes (50 MB). The minimum value is 1024 bytes. |
......
......@@ -108,6 +108,7 @@ Access the default page for admin area settings by navigating to **Admin Area >
| Option | Description |
| ------ | ----------- |
| [Email](email.md) | Various email settings. |
| [What's new](../../../administration/whats-new.md) | Configure What's new drawer and content. |
| [Help page](help_page.md) | Help page text and support page URL. |
| [Pages](../../../administration/pages/index.md#custom-domain-verification) | Size and domain settings for static websites |
| [Real-time features](../../../administration/polling.md) | Change this value to influence how frequently the GitLab UI polls for updates. |
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
let(:fixture_dir_glob) { Dir.glob(File.join('spec', 'fixtures', 'whats_new', '*.yml')).grep(/\d*\_(\d*\_\d*)\.yml$/) }
let(:starter_plan) { create(:license, plan: License::STARTER_PLAN) }
let(:premium_plan) { create(:license, plan: License::PREMIUM_PLAN) }
let(:ultimate_plan) { create(:license, plan: License::ULTIMATE_PLAN) }
before do
allow(Dir).to receive(:glob).with(Rails.root.join('data', 'whats_new', '*.yml')).and_return(fixture_dir_glob)
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[:all_tiers])
end
after do
ReleaseHighlight.instance_variable_set(:@file_paths, nil)
end
describe '.load_items' do
context 'whats new for current tier only' do
before do
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[:all_tiers])
end
it 'returns all items' do
items = described_class.load_items(page: 2)
expect(items.count).to eq(3)
end
end
context 'whats new for current tier only' do
before do
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[:current_tier])
end
context 'with no license' do
it 'returns items with package=Free' do
items = described_class.load_items(page: 2)
expect(items.count).to eq(1)
expect(items.first['packages']).to include('Free')
end
end
context 'with Starter license' do
before do
allow(License).to receive(:current).and_return(starter_plan)
end
it 'returns items with package=Free' do
items = described_class.load_items(page: 2)
expect(items.count).to eq(1)
expect(items.first['packages']).to include('Free')
end
end
context 'with Premium license' do
before do
allow(License).to receive(:current).and_return(premium_plan)
end
it 'returns items with package=Premium' do
items = described_class.load_items(page: 2)
expect(items.count).to eq(2)
expect(items.map { |item| item['packages'] }).to all( include('Premium') )
end
end
context 'with Ultimate license' do
before do
allow(License).to receive(:current).and_return(ultimate_plan)
end
it 'returns items with package=Ultimate' do
items = described_class.load_items(page: 2)
expect(items.count).to eq(3)
expect(items.map { |item| item['packages'] }).to all( include('Ultimate') )
end
end
end
end
describe '.current_package' do
subject { described_class.current_package }
it 'returns package for no license' do
allow(License).to receive(:current).and_return(nil)
expect(subject).to eq('Free')
end
it 'returns package for Starter license' do
allow(License).to receive(:current).and_return(starter_plan)
expect(subject).to eq('Free')
end
it 'returns package for Premium license' do
allow(License).to receive(:current).and_return(premium_plan)
expect(subject).to eq('Premium')
end
it 'returns package for Ultimate license' do
allow(License).to receive(:current).and_return(ultimate_plan)
expect(subject).to eq('Ultimate')
end
end
end
......@@ -169,6 +169,7 @@ module API
optional :raw_blob_request_limit, type: Integer, desc: "Maximum number of requests per minute for each raw path. Set to 0 for unlimited requests per minute."
optional :wiki_page_max_content_bytes, type: Integer, desc: "Maximum wiki page content size in bytes"
optional :require_admin_approval_after_user_signup, type: Boolean, desc: 'Require explicit admin approval for new signups'
optional :whats_new_variant, type: String, values: ApplicationSetting.whats_new_variants.keys, desc: "What's new variant, possible values: `all_tiers`, `current_tier`, and `disabled`."
ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type|
optional :"#{type}_key_restriction",
......
......@@ -8311,6 +8311,9 @@ msgstr ""
msgid "Configure Tracing"
msgstr ""
msgid "Configure What's new drawer and content."
msgstr ""
msgid "Configure a %{codeStart}.gitlab-webide.yml%{codeEnd} file in the %{codeStart}.gitlab%{codeEnd} directory to start using the Web Terminal. %{helpStart}Learn more.%{helpEnd}"
msgstr ""
......@@ -11376,6 +11379,9 @@ msgstr ""
msgid "Disable Two-factor Authentication"
msgstr ""
msgid "Disable What's new"
msgstr ""
msgid "Disable for this project"
msgstr ""
......@@ -12026,6 +12032,12 @@ msgstr ""
msgid "Enable Spam Check via external API endpoint"
msgstr ""
msgid "Enable What's new: All tiers"
msgstr ""
msgid "Enable What's new: Current tier only"
msgstr ""
msgid "Enable access to Grafana"
msgstr ""
......@@ -35907,6 +35919,15 @@ msgstr ""
msgid "What's new"
msgstr ""
msgid "What's new is disabled and can no longer be viewed."
msgstr ""
msgid "What's new presents new features for your current subscription tier, while hiding new features not available to your subscription tier."
msgstr ""
msgid "What's new presents new features from all tiers to help you keep track of all new features."
msgstr ""
msgid "What’s your experience level?"
msgstr ""
......
......@@ -34,6 +34,24 @@ RSpec.describe "renders a `whats new` dropdown item" do
sign_in(user)
end
it 'renders dropdown item when feature enabled' do
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[:all_tiers])
visit root_dashboard_path
find('.header-help-dropdown-toggle').click
expect(page).to have_button(text: "What's new")
end
it 'does not render dropdown item when feature disabled' do
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[:disabled])
visit root_dashboard_path
find('.header-help-dropdown-toggle').click
expect(page).not_to have_button(text: "What's new")
end
it 'shows notification dot and count and removes it once viewed' do
visit root_dashboard_path
......
---
- title: View epics on a board
body: |
## View epics on a board
self-managed: true
gitlab-com: false
packages: ["Free", "Premium", "Ultimate"]
- title: View Jira issue details in GitLab
body: |
## View Jira issue details in GitLab
self-managed: true
gitlab-com: false
packages: ["Premium", "Ultimate"]
- title: Integrate any IT alerting tool with GitLab
body: |
## Integrate any IT alerting tool with GitLab
self-managed: true
gitlab-com: false
packages: ["Ultimate"]
\ No newline at end of file
......@@ -59,5 +59,62 @@ RSpec.describe WhatsNewHelper do
expect(subject).to be false
end
end
context 'depending on whats_new_variant' do
using RSpec::Parameterized::TableSyntax
where(:variant, :result) do
:all_tiers | true
:current_tier | true
:disabled | false
end
with_them do
it 'returns correct result depending on variant' do
allow(Gitlab).to receive(:dev_env_org_or_com?).and_return(true)
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[variant])
expect(subject).to eq(result)
end
end
end
end
describe '#whats_new_variants' do
it 'returns ApplicationSetting.whats_new_variants' do
expect(helper.whats_new_variants).to eq(ApplicationSetting.whats_new_variants)
end
end
describe '#whats_new_variants_label' do
let(:labels) do
[
helper.whats_new_variants_label('all_tiers'),
helper.whats_new_variants_label('current_tier'),
helper.whats_new_variants_label('disabled'),
helper.whats_new_variants_label(nil)
]
end
it 'returns different labels depending on variant' do
expect(labels.uniq.size).to eq(labels.size)
expect(labels[3]).to be_nil
end
end
describe '#whats_new_variants_description' do
let(:descriptions) do
[
helper.whats_new_variants_description('all_tiers'),
helper.whats_new_variants_description('current_tier'),
helper.whats_new_variants_description('disabled'),
helper.whats_new_variants_description(nil)
]
end
it 'returns different descriptions depending on variant' do
expect(descriptions.uniq.size).to eq(descriptions.size)
expect(descriptions[3]).to be_nil
end
end
end
......@@ -129,6 +129,11 @@ RSpec.describe ApplicationSetting do
it { is_expected.not_to allow_value(nil).for(:notes_create_limit_allowlist) }
it { is_expected.to allow_value([]).for(:notes_create_limit_allowlist) }
it { is_expected.to allow_value('all_tiers').for(:whats_new_variant) }
it { is_expected.to allow_value('current_tier').for(:whats_new_variant) }
it { is_expected.to allow_value('disabled').for(:whats_new_variant) }
it { is_expected.not_to allow_value(nil).for(:whats_new_variant) }
context 'help_page_documentation_base_url validations' do
it { is_expected.to allow_value(nil).for(:help_page_documentation_base_url) }
it { is_expected.to allow_value('https://docs.gitlab.com').for(:help_page_documentation_base_url) }
......
......@@ -7,6 +7,7 @@ RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
before do
allow(Dir).to receive(:glob).with(Rails.root.join('data', 'whats_new', '*.yml')).and_return(fixture_dir_glob)
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[:all_tiers])
end
after do
......@@ -24,16 +25,16 @@ RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
subject { ReleaseHighlight.paginated(page: page) }
context 'when there is another page of results' do
let(:page) { 2 }
let(:page) { 3 }
it 'responds with paginated results' do
expect(subject[:items].first['title']).to eq('bright')
expect(subject[:next_page]).to eq(3)
expect(subject[:next_page]).to eq(4)
end
end
context 'when there is NOT another page of results' do
let(:page) { 3 }
let(:page) { 4 }
it 'responds with paginated results and no next_page' do
expect(subject[:items].first['title']).to eq("It's gonna be a bright")
......@@ -54,8 +55,8 @@ RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
subject { ReleaseHighlight.paginated }
it 'uses multiple levels of cache' do
expect(Rails.cache).to receive(:fetch).with("release_highlight:items:page-1:#{Gitlab.revision}", { expires_in: described_class::CACHE_DURATION }).and_call_original
expect(Rails.cache).to receive(:fetch).with("release_highlight:file_paths:#{Gitlab.revision}", { expires_in: described_class::CACHE_DURATION }).and_call_original
expect(Rails.cache).to receive(:fetch).with("release_highlight:all_tiers:items:page-1:#{Gitlab.revision}", { expires_in: described_class::CACHE_DURATION }).and_call_original
expect(Rails.cache).to receive(:fetch).with("release_highlight:all_tiers:file_paths:#{Gitlab.revision}", { expires_in: described_class::CACHE_DURATION }).and_call_original
subject
end
......@@ -101,7 +102,7 @@ RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
subject { ReleaseHighlight.most_recent_item_count }
it 'uses process memory cache' do
expect(Gitlab::ProcessMemoryCache.cache_backend).to receive(:fetch).with("release_highlight:recent_item_count:#{Gitlab.revision}", expires_in: described_class::CACHE_DURATION)
expect(Gitlab::ProcessMemoryCache.cache_backend).to receive(:fetch).with("release_highlight:all_tiers:recent_item_count:#{Gitlab.revision}", expires_in: described_class::CACHE_DURATION)
subject
end
......@@ -127,7 +128,7 @@ RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
subject { ReleaseHighlight.most_recent_version_digest }
it 'uses process memory cache' do
expect(Gitlab::ProcessMemoryCache.cache_backend).to receive(:fetch).with("release_highlight:most_recent_version_digest:#{Gitlab.revision}", expires_in: described_class::CACHE_DURATION)
expect(Gitlab::ProcessMemoryCache.cache_backend).to receive(:fetch).with("release_highlight:all_tiers:most_recent_version_digest:#{Gitlab.revision}", expires_in: described_class::CACHE_DURATION)
subject
end
......@@ -148,6 +149,33 @@ RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
end
end
describe '.load_items' do
context 'whats new for all tiers' do
before do
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[:all_tiers])
end
it 'returns all items' do
items = described_class.load_items(page: 2)
expect(items.count).to eq(3)
end
end
context 'whats new for current tier only' do
before do
Gitlab::CurrentSettings.update!(whats_new_variant: ApplicationSetting.whats_new_variants[:current_tier])
end
it 'returns items with package=Free' do
items = described_class.load_items(page: 2)
expect(items.count).to eq(1)
expect(items.first['title']).to eq("View epics on a board")
end
end
end
describe 'QueryResult' do
subject { ReleaseHighlight::QueryResult.new(items: items, next_page: 2) }
......@@ -157,4 +185,12 @@ RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
expect(subject.map(&:to_s)).to eq(items.map(&:to_s))
end
end
describe '.current_package' do
subject { described_class.current_package }
it 'returns Free' do
expect(subject).to eq('Free')
end
end
end
......@@ -45,6 +45,7 @@ RSpec.describe API::Settings, 'Settings', :do_not_mock_admin_mode_setting do
expect(json_response['require_admin_approval_after_user_signup']).to eq(true)
expect(json_response['personal_access_token_prefix']).to be_nil
expect(json_response['admin_mode']).to be(false)
expect(json_response['whats_new_variant']).to eq('all_tiers')
end
end
......@@ -485,5 +486,32 @@ RSpec.describe API::Settings, 'Settings', :do_not_mock_admin_mode_setting do
end
end
end
context 'whats_new_variant setting' do
before do
Gitlab::CurrentSettings.current_application_settings.whats_new_variant_disabled!
end
it 'updates setting' do
new_value = 'all_tiers'
put api("/application/settings", admin),
params: {
whats_new_variant: new_value
}
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['whats_new_variant']).to eq(new_value)
end
it 'fails to update setting with invalid value' do
put api("/application/settings", admin),
params: {
whats_new_variant: 'invalid_value'
}
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['error']).to eq('whats_new_variant does not have a valid value')
end
end
end
end
......@@ -7,7 +7,7 @@ RSpec.describe WhatsNewController, :clean_gitlab_redis_cache do
ReleaseHighlight.instance_variable_set(:@file_paths, nil)
end
describe 'whats_new_path' do
describe 'GET #index' do
let(:item) { double(:item) }
let(:highlights) { double(:highlight, items: [item], map: [item].map, next_page: 2) }
......@@ -35,5 +35,17 @@ RSpec.describe WhatsNewController, :clean_gitlab_redis_cache do
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'with whats_new_variant = disabled' do
before do
Gitlab::CurrentSettings.current_application_settings.whats_new_variant_disabled!
end
it 'returns a 404' do
get whats_new_path, xhr: true
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment