summaryrefslogtreecommitdiff
path: root/spec/requests/whats_new_controller_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /spec/requests/whats_new_controller_spec.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/requests/whats_new_controller_spec.rb')
-rw-r--r--spec/requests/whats_new_controller_spec.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/requests/whats_new_controller_spec.rb b/spec/requests/whats_new_controller_spec.rb
new file mode 100644
index 00000000000..29500a7b5f9
--- /dev/null
+++ b/spec/requests/whats_new_controller_spec.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe WhatsNewController do
+ describe 'whats_new_path' do
+ before do
+ allow_any_instance_of(WhatsNewController).to receive(:whats_new_most_recent_release_items).and_return('items')
+ end
+
+ context 'with whats_new_drawer feature enabled' do
+ before do
+ stub_feature_flags(whats_new_drawer: true)
+ end
+
+ it 'is successful' do
+ get whats_new_path, xhr: true
+
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+ end
+
+ context 'with whats_new_drawer feature disabled' do
+ before do
+ stub_feature_flags(whats_new_drawer: false)
+ 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