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
ed13a9f2
Commit
ed13a9f2
authored
Sep 21, 2020
by
Jake Lear
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test stub for gitlab_bot?
parent
8df23c28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
ee/app/models/ee/user.rb
ee/app/models/ee/user.rb
+0
-4
ee/spec/models/user_spec.rb
ee/spec/models/user_spec.rb
+20
-0
No files found.
ee/app/models/ee/user.rb
View file @
ed13a9f2
...
...
@@ -360,11 +360,7 @@ module EE
def
gitlab_bot?
strong_memoize
(
:gitlab_bot
)
do
if
::
Gitlab
.
com?
bot?
&&
::
Gitlab
::
Com
.
gitlab_com_group_member_id?
(
id
)
else
false
end
end
end
...
...
ee/spec/models/user_spec.rb
View file @
ed13a9f2
...
...
@@ -1286,6 +1286,26 @@ RSpec.describe User do
end
end
describe
'#gitlab_bot?'
do
using
RSpec
::
Parameterized
::
TableSyntax
subject
{
user
.
gitlab_bot?
}
let_it_be
(
:gitlab_group
)
{
create
(
:group
,
name:
'gitlab-com'
)
}
context
'based on user type'
do
context
'when user is a bot'
do
let
(
:user
)
{
build
(
:user
,
user_type: :alert_bot
)
}
before
do
gitlab_group
.
add_user
(
user
,
Gitlab
::
Access
::
DEVELOPER
)
end
it
{
is_expected
.
to
be
true
}
end
end
end
describe
'#security_dashboard'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
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