Commit 75424b0f authored by Stan Hu's avatar Stan Hu

Merge branch 'id-fix-rack-spec-warnings' into 'master'

Fix rack_attack_global_spec 2.7 warnings

See merge request gitlab-org/gitlab!50874
parents e59fa655 87fd5bbf
...@@ -196,8 +196,8 @@ RSpec.describe 'Rack Attack global throttles' do ...@@ -196,8 +196,8 @@ RSpec.describe 'Rack Attack global throttles' do
let(:api_partial_url) { '/todos' } let(:api_partial_url) { '/todos' }
context 'with the token in the query string' do context 'with the token in the query string' do
let(:request_args) { [api(api_partial_url, personal_access_token: token)] } let(:request_args) { [api(api_partial_url, personal_access_token: token), {}] }
let(:other_user_request_args) { [api(api_partial_url, personal_access_token: other_user_token)] } let(:other_user_request_args) { [api(api_partial_url, personal_access_token: other_user_token), {}] }
it_behaves_like 'rate-limited token-authenticated requests' it_behaves_like 'rate-limited token-authenticated requests'
end end
...@@ -258,8 +258,8 @@ RSpec.describe 'Rack Attack global throttles' do ...@@ -258,8 +258,8 @@ RSpec.describe 'Rack Attack global throttles' do
let(:api_partial_url) { '/todos' } let(:api_partial_url) { '/todos' }
context 'with the token in the query string' do context 'with the token in the query string' do
let(:request_args) { [api(api_partial_url, oauth_access_token: token)] } let(:request_args) { [api(api_partial_url, oauth_access_token: token), {}] }
let(:other_user_request_args) { [api(api_partial_url, oauth_access_token: other_user_token)] } let(:other_user_request_args) { [api(api_partial_url, oauth_access_token: other_user_token), {}] }
it_behaves_like 'rate-limited token-authenticated requests' it_behaves_like 'rate-limited token-authenticated requests'
end end
...@@ -376,8 +376,8 @@ RSpec.describe 'Rack Attack global throttles' do ...@@ -376,8 +376,8 @@ RSpec.describe 'Rack Attack global throttles' do
end end
context 'with the token in the query string' do context 'with the token in the query string' do
let(:request_args) { [api(api_partial_url, personal_access_token: token)] } let(:request_args) { [api(api_partial_url, personal_access_token: token), {}] }
let(:other_user_request_args) { [api(api_partial_url, personal_access_token: other_user_token)] } let(:other_user_request_args) { [api(api_partial_url, personal_access_token: other_user_token), {}] }
it_behaves_like 'rate-limited token-authenticated requests' it_behaves_like 'rate-limited token-authenticated requests'
end end
......
...@@ -154,10 +154,11 @@ RSpec.shared_examples 'rate-limited token-authenticated requests' do ...@@ -154,10 +154,11 @@ RSpec.shared_examples 'rate-limited token-authenticated requests' do
end end
def make_request(args) def make_request(args)
path, options = args
if request_method == 'POST' if request_method == 'POST'
post(*args) post(path, **options)
else else
get(*args) get(path, **options)
end end
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