Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-08-27 22:01:09 +0300
committerLin Jen-Shin <godfat@godfat.org>2019-08-27 22:01:09 +0300
commit4eecb0ad965e29a84ce6209d559d40c13b0de505 (patch)
treed15de811f11abbbd37b2d0ea7c4ce2e1332855c8
parentde385eee8507a35f1c01ca784ba9aab9bc38e11d (diff)
parente17ba8d9e32c9d547ff9ca31056bbf7abd864488 (diff)
Merge branch 'fix-nil-error-in-gitlab-danger-teammate' into 'master'
Fix a nil error in Gitlab::Danger::Teammate See merge request gitlab-org/gitlab-ce!32284
-rw-r--r--lib/gitlab/danger/teammate.rb4
-rw-r--r--spec/lib/gitlab/danger/teammate_spec.rb8
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/danger/teammate.rb b/lib/gitlab/danger/teammate.rb
index 8ae4ffdadb0..2789706aa3b 100644
--- a/lib/gitlab/danger/teammate.rb
+++ b/lib/gitlab/danger/teammate.rb
@@ -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
diff --git a/spec/lib/gitlab/danger/teammate_spec.rb b/spec/lib/gitlab/danger/teammate_spec.rb
index 61b43e343c1..afbc3896a70 100644
--- a/spec/lib/gitlab/danger/teammate_spec.rb
+++ b/spec/lib/gitlab/danger/teammate_spec.rb
@@ -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' }