summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-02-13 18:20:01 +0100
committerRémy Coutable <remy@rymai.me>2018-02-14 11:06:49 +0100
commit407c60e74a9eee161f4a6dccf51b94bc641106c2 (patch)
tree073819031120bab7353cbaf2ab3156907faf6e2d
parente7595c10bc14cd32c456b9c6a94e227d41d6d09a (diff)
downloadgitlab-ce-ce-port-ee-f531c07299.tar.gz
Fix a too strict array-matching expectationce-port-ee-f531c07299
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--spec/requests/openid_connect_spec.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/requests/openid_connect_spec.rb b/spec/requests/openid_connect_spec.rb
index 5d349f45a33..61966d41dd3 100644
--- a/spec/requests/openid_connect_spec.rb
+++ b/spec/requests/openid_connect_spec.rb
@@ -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_including(expected_groups))
end
end