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
e17ba8d9
Commit
e17ba8d9
authored
Aug 27, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a nil error in Gitlab::Danger::Teammate
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
ca5724be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
lib/gitlab/danger/teammate.rb
lib/gitlab/danger/teammate.rb
+2
-2
spec/lib/gitlab/danger/teammate_spec.rb
spec/lib/gitlab/danger/teammate_spec.rb
+8
-0
No files found.
lib/gitlab/danger/teammate.rb
View file @
e17ba8d9
...
...
@@ -39,9 +39,9 @@ module Gitlab
def
has_capability?
(
project
,
category
,
kind
,
labels
)
case
category
when
:test
area
=
role
[
/Test Automation Engineer(?:.*?, (\w+))/
,
1
]
.
downcase
area
=
role
[
/Test Automation Engineer(?:.*?, (\w+))/
,
1
]
area
&&
labels
.
any?
(
"devops::
#{
area
}
"
)
if
kind
==
:reviewer
area
&&
labels
.
any?
(
"devops::
#{
area
.
downcase
}
"
)
if
kind
==
:reviewer
else
capabilities
(
project
).
include?
(
"
#{
kind
}
#{
category
}
"
)
end
...
...
spec/lib/gitlab/danger/teammate_spec.rb
View file @
e17ba8d9
...
...
@@ -50,6 +50,14 @@ describe Gitlab::Danger::Teammate do
end
end
context
'when role is Test Automation Engineer'
do
let
(
:role
)
{
'Test Automation Engineer'
}
it
'#reviewer? returns false'
do
expect
(
subject
.
reviewer?
(
project
,
:test
,
labels
)).
to
be_falsey
end
end
context
'when role is Test Automation Engineer, Manage'
do
let
(
:role
)
{
'Test Automation Engineer, Manage'
}
...
...
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