Commit c191e4af authored by Bob Van Landuyt's avatar Bob Van Landuyt

Check global feature directly on `License` class

Global features should be checked directly on the license
class `external_authorization` is one of these features.
parent 676d41a0
......@@ -24,7 +24,7 @@ module EE
expose :only_mirror_protected_branches, if: ->(project, _) { project.mirror? }
expose :mirror_overwrites_diverged_branches, if: ->(project, _) { project.mirror? }
expose :external_authorization_classification_label,
if: ->(project, _) { project.feature_available?(:external_authorization_service) }
if: ->(_, _) { License.feature_available?(:external_authorization_service) }
end
end
......
......@@ -6,6 +6,20 @@ describe API::Projects do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
describe 'GET /projects' do
it 'does not break on license checks' do
stub_licensed_features(external_authorization_service: true)
enable_namespace_license_check!
create(:project, :private, namespace: user.namespace)
create(:project, :public, namespace: user.namespace)
get api('/projects', user)
expect(response).to have_gitlab_http_status(200)
end
end
describe 'POST /projects' do
context 'when importing with mirror attributes' do
let(:import_url) { generate(:url) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment