Skip to content
代码片段 群组 项目
未验证 提交 5064bba5 编辑于 作者: Huzaifa Iftikhar's avatar Huzaifa Iftikhar 提交者: GitLab
浏览文件

Merge branch 'add-auditor-badge-to-admin-users-page' into 'master'

No related branches found
No related tags found
无相关合并请求
......@@ -19,6 +19,8 @@ def impersonation_tokens_enabled?
def user_badges_in_admin_section(user)
super(user).tap do |badges|
badges << { text: s_('AdminUsers|Auditor'), variant: 'neutral' } if user.auditor?
if !::Gitlab.com? && user.using_license_seat?
it_s_you_index = badges.index { |badge| badge[:text] == "It's you!" } || -1
......
......@@ -87,6 +87,20 @@
end
end
context 'when user is an auditor' do
before do
allow(user).to receive(:auditor?).and_return(true)
end
it 'returns the auditor badge' do
expect(subject).to eq(
[
{ text: 'Auditor', variant: 'neutral' }
]
)
end
end
it { expect(subject).not_to eq([text: 'Is using seat', variant: 'light']) }
end
......@@ -115,6 +129,21 @@
end
end
context 'when user is an auditor' do
before do
allow(user).to receive(:auditor?).and_return(true)
end
it 'returns the auditor badge' do
expect(subject).to eq(
[
{ text: 'Auditor', variant: 'neutral' },
{ text: 'Is using seat', variant: 'neutral' }
]
)
end
end
it { expect(subject).to eq([text: 'Is using seat', variant: 'neutral']) }
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册