Commit 9f04b5a1 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'bvl-fix-lic-check' into 'master'

Check global feature directly on `License` class

Closes #8484

See merge request gitlab-org/gitlab-ee!8505
parents b6e9a5a3 c191e4af
......@@ -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