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:
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