BigW Consortium Gitlab

Fix a too strict array-matching expectation

Signed-off-by: 's avatarRémy Coutable <remy@rymai.me>
parent e7595c10
......@@ -81,7 +81,7 @@ describe 'OpenID Connect requests' do
it 'includes all user information and group memberships' do
request_user_info
expect(json_response).to eq({
expect(json_response).to match(a_hash_including({
'sub' => hashed_subject,
'name' => 'Alice',
'nickname' => 'alice',
......@@ -90,13 +90,12 @@ describe 'OpenID Connect requests' do
'website' => 'https://example.com',
'profile' => 'http://localhost/alice',
'picture' => "http://localhost/uploads/-/system/user/avatar/#{user.id}/dk.png",
'groups' =>
if Group.supports_nested_groups?
['group1', 'group2/group3', 'group2/group3/group4']
else
['group1', 'group2/group3']
end
})
'groups' => anything
}))
expected_groups = %w[group1 group2/group3]
expected_groups << 'group2/group3/group4' if Group.supports_nested_groups?
expect(json_response['groups']).to match_array(expected_groups)
end
end
......
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