Commit fff0fc7b authored by Sean McGivern's avatar Sean McGivern

Merge branch '65317-adapt-tae-role-name-change' into 'master'

Fix Danger finding a test reviewer

Closes #65317

See merge request gitlab-org/gitlab-ce!31292
parents 533237a0 89a8d02c
......@@ -39,7 +39,7 @@ module Gitlab
def has_capability?(project, category, kind, labels)
case category
when :test
area = role[/Test Automation Engineer, (\w+)/, 1]
area = role[/Test Automation Engineer(?:.*?, (\w+))/, 1]
area && labels.any?(area) if kind == :reviewer
else
......
# frozen_string_literal: true
require 'rails_helper'
require 'spec_helper'
describe Projects::ErrorTrackingController do
set(:project) { create(:project) }
......
# frozen_string_literal: true
require 'rails_helper'
require 'spec_helper'
describe 'Display system header and footer bar' do
let(:header_message) { "Foo" }
......
......@@ -40,6 +40,14 @@ describe Gitlab::Danger::Teammate do
it '#maintainer? returns false' do
expect(subject.maintainer?(project, :test, labels)).to be_falsey
end
context 'when hyperlink is mangled in the role' do
let(:role) { '<a href="#">Test Automation Engineer</a>, Create' }
it '#reviewer? returns true' do
expect(subject.reviewer?(project, :test, labels)).to be_truthy
end
end
end
context 'when role is Test Automation Engineer, Manage' 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