blob: bd54b50de99f89db9ec3f2f76ed448153b97dae2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Organizations::OrganizationsController, feature_category: :cell do
let_it_be(:organization) { create(:organization) }
RSpec.shared_examples 'basic organization controller action' do
before do
sign_in(user)
end
context 'when the user does not have authorization' do
let_it_be(:user) { create(:user) }
it 'renders 404' do
gitlab_request
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when the user has authorization', :enable_admin_mode do
let_it_be(:user) { create(:admin) }
it 'renders 200 OK' do
gitlab_request
expect(response).to have_gitlab_http_status(:ok)
end
context 'when the feature flag `ui_for_organizations` is disabled' do
it 'renders 404' do
stub_feature_flags(ui_for_organizations: false)
gitlab_request
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
end
describe 'GET #show' do
subject(:gitlab_request) { get organization_path(organization) }
it_behaves_like 'basic organization controller action'
end
describe 'GET #groups_and_projects' do
subject(:gitlab_request) { get groups_and_projects_organization_path(organization) }
it_behaves_like 'basic organization controller action'
end
end
|