Commit bbd574e3 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch...

Merge branch '235736-follow-up-from-enable-resource_access_token-feature-flag-by-default' into 'master'

Update PrAT feature check to return false for gitlab.com

Closes #235736

See merge request gitlab-org/gitlab!39358
parents 53a4483b 0890b523
......@@ -32,6 +32,8 @@ module ResourceAccessTokens
attr_reader :resource_type, :resource
def feature_enabled?
return false if ::Gitlab.com?
::Feature.enabled?(:resource_access_token, resource, default_enabled: true)
end
......
......@@ -34,6 +34,16 @@ RSpec.describe ResourceAccessTokens::CreateService do
end
end
shared_examples 'fails on gitlab.com' do
before do
allow(Gitlab).to receive(:com?) { true }
end
it 'returns nil' do
expect(subject).to be nil
end
end
shared_examples 'allows creation of bot with valid params' do
it { expect { subject }.to change { User.count }.by(1) }
......@@ -171,6 +181,7 @@ RSpec.describe ResourceAccessTokens::CreateService do
it_behaves_like 'fails when user does not have the permission to create a Resource Bot'
it_behaves_like 'fails when flag is disabled'
it_behaves_like 'fails on gitlab.com'
context 'user with valid permission' do
before_all do
......
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