Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0890b523
Commit
0890b523
authored
Aug 12, 2020
by
peterhegman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update PrAT feature check to return false for gitlab.com
Not ready to be released for gitlab.com yet
parent
867e1ff1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/services/resource_access_tokens/create_service.rb
app/services/resource_access_tokens/create_service.rb
+2
-0
spec/services/resource_access_tokens/create_service_spec.rb
spec/services/resource_access_tokens/create_service_spec.rb
+11
-0
No files found.
app/services/resource_access_tokens/create_service.rb
View file @
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
...
...
spec/services/resource_access_tokens/create_service_spec.rb
View file @
0890b523
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment