Commit 87fd5bbf authored by Igor Drozdov's avatar Igor Drozdov

Fix rack_attack_global_spec 2.7 warnings

parent e049419a
...@@ -178,8 +178,8 @@ RSpec.describe 'Rack Attack global throttles' do ...@@ -178,8 +178,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
...@@ -205,8 +205,8 @@ RSpec.describe 'Rack Attack global throttles' do ...@@ -205,8 +205,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
...@@ -314,8 +314,8 @@ RSpec.describe 'Rack Attack global throttles' do ...@@ -314,8 +314,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