From 10fd79745df7b572fc79fd84b58e818e64bf2571 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 16 Jun 2020 15:08:32 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/requests/api/oauth_tokens_spec.rb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'spec/requests/api/oauth_tokens_spec.rb') diff --git a/spec/requests/api/oauth_tokens_spec.rb b/spec/requests/api/oauth_tokens_spec.rb index 3266fed1741..5e775841f12 100644 --- a/spec/requests/api/oauth_tokens_spec.rb +++ b/spec/requests/api/oauth_tokens_spec.rb @@ -3,20 +3,9 @@ require 'spec_helper' describe 'OAuth tokens' do - context 'Resource Owner Password Credentials' do - def basic_auth_header(username, password) - { - 'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials( - username, - password - ) - } - end - - def client_basic_auth_header(client) - basic_auth_header(client.uid, client.secret) - end + include HttpBasicAuthHelpers + context 'Resource Owner Password Credentials' do def request_oauth_token(user, headers = {}) post '/oauth/token', params: { username: user.username, password: user.password, grant_type: 'password' }, -- cgit v1.2.3