Commit 5c686142 authored by Rémy Coutable's avatar Rémy Coutable

Fix a too strict array-matching expectation

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent a21db9b9
...@@ -81,7 +81,7 @@ describe 'OpenID Connect requests' do ...@@ -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,16 @@ describe 'OpenID Connect requests' do ...@@ -90,13 +90,16 @@ 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 =
['group1', 'group2/group3'] if Group.supports_nested_groups?
end ['group1', 'group2/group3', 'group2/group3/group4']
}) else
['group1', 'group2/group3']
end
expect(json_response['groups']).to match(array_including(expected_groups))
end end
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