Fix a too strict array-matching expectation
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
e7595c10bc
commit
539b3a3532
1 changed files with 7 additions and 8 deletions
|
@ -81,7 +81,7 @@ describe 'OpenID Connect requests' do
|
||||||
it 'includes all user information and group memberships' do
|
it 'includes all user information and group memberships' do
|
||||||
request_user_info
|
request_user_info
|
||||||
|
|
||||||
expect(json_response).to eq({
|
expect(json_response).to match(a_hash_including({
|
||||||
'sub' => hashed_subject,
|
'sub' => hashed_subject,
|
||||||
'name' => 'Alice',
|
'name' => 'Alice',
|
||||||
'nickname' => 'alice',
|
'nickname' => 'alice',
|
||||||
|
@ -90,13 +90,12 @@ describe 'OpenID Connect requests' do
|
||||||
'website' => 'https://example.com',
|
'website' => 'https://example.com',
|
||||||
'profile' => 'http://localhost/alice',
|
'profile' => 'http://localhost/alice',
|
||||||
'picture' => "http://localhost/uploads/-/system/user/avatar/#{user.id}/dk.png",
|
'picture' => "http://localhost/uploads/-/system/user/avatar/#{user.id}/dk.png",
|
||||||
'groups' =>
|
'groups' => anything
|
||||||
if Group.supports_nested_groups?
|
}))
|
||||||
['group1', 'group2/group3', 'group2/group3/group4']
|
|
||||||
else
|
expected_groups = %w[group1 group2/group3]
|
||||||
['group1', 'group2/group3']
|
expected_groups << 'group2/group3/group4' if Group.supports_nested_groups?
|
||||||
end
|
expect(json_response['groups']).to match_array(expected_groups)
|
||||||
})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue