Commit ed13a9f2 authored by Jake Lear's avatar Jake Lear

Test stub for gitlab_bot?

parent 8df23c28
......@@ -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
......
......@@ -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) }
......
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