Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-10-03 15:13:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-03 15:13:29 +0300
commitd9ec4caf8fe4a4315e8e09e48d3ec79fd0a724c5 (patch)
tree9bff42fdcadcee465c800a3458322fa0fa815135 /spec/support/shared_examples/requests
parent49bd8609775923402610f4c7f7c1f8aa1efdfe7e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/requests')
-rw-r--r--spec/support/shared_examples/requests/organizations_shared_examples.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/support/shared_examples/requests/organizations_shared_examples.rb b/spec/support/shared_examples/requests/organizations_shared_examples.rb
new file mode 100644
index 00000000000..78e7c3c6bde
--- /dev/null
+++ b/spec/support/shared_examples/requests/organizations_shared_examples.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'organization - successful response' do
+ it 'renders 200 OK' do
+ gitlab_request
+
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+end
+
+RSpec.shared_examples 'organization - not found response' do
+ it 'renders 404 NOT_FOUND' do
+ gitlab_request
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+end
+
+RSpec.shared_examples 'organization - redirects to sign in page' do
+ it 'redirects to sign in page' do
+ gitlab_request
+
+ expect(response).to redirect_to(new_user_session_path)
+ end
+end
+
+RSpec.shared_examples 'organization - action disabled by `ui_for_organizations` feature flag' do
+ context 'when `ui_for_organizations` feature flag is disabled' do
+ before do
+ stub_feature_flags(ui_for_organizations: false)
+ end
+
+ it_behaves_like 'organization - not found response'
+ end
+end