From d9ec4caf8fe4a4315e8e09e48d3ec79fd0a724c5 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 3 Oct 2023 12:13:29 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../requests/organizations_shared_examples.rb | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 spec/support/shared_examples/requests/organizations_shared_examples.rb (limited to 'spec/support/shared_examples/requests') 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 -- cgit v1.2.3