Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/jira_authorizations_spec.rb')
-rw-r--r--spec/requests/jira_authorizations_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/requests/jira_authorizations_spec.rb b/spec/requests/jira_authorizations_spec.rb
index b43d36e94f4..f67288b286b 100644
--- a/spec/requests/jira_authorizations_spec.rb
+++ b/spec/requests/jira_authorizations_spec.rb
@@ -27,14 +27,16 @@ RSpec.describe 'Jira authorization requests' do
redirect_uri: redirect_uri
})
oauth_response = json_response
+ oauth_response_access_token, scope, token_type = oauth_response.values_at('access_token', 'scope', 'token_type')
post '/login/oauth/access_token', params: post_data.merge({
code: generate_access_grant.token
})
jira_response = response.body
+ jira_response_access_token = Rack::Utils.parse_nested_query(jira_response)['access_token']
- access_token, scope, token_type = oauth_response.values_at('access_token', 'scope', 'token_type')
- expect(jira_response).to eq("access_token=#{access_token}&scope=#{scope}&token_type=#{token_type}")
+ expect(jira_response).to include("scope=#{scope}&token_type=#{token_type}")
+ expect(oauth_response_access_token).not_to eql(jira_response_access_token)
end
context 'when authorization fails' do