summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-02-14 14:44:37 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-02-14 14:44:37 +0000
commitfd4728a5042a46b62e73aca593f6983165e0bbd7 (patch)
treecab2831e62a50c0b9b4ac252440237ec6fbd85fd
parent7294bc80c373356ab77f9822c22a0330323b73d9 (diff)
parent539b3a3532bae17b8f9ce48628046ee43812f5ec (diff)
downloadgitlab-ce-fd4728a5042a46b62e73aca593f6983165e0bbd7.tar.gz
Merge branch 'ce-port-ee-f531c07299' into 'master'
Fix a too strict array-matching expectation See merge request gitlab-org/gitlab-ce!17093
-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..de829011e58 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(expected_groups)
end
end