Use `expect(subject)` rather than `is_expected`

parent 7addf910
...@@ -49,21 +49,21 @@ describe Gitlab::Middleware::ReadonlyGeo do ...@@ -49,21 +49,21 @@ describe Gitlab::Middleware::ReadonlyGeo do
response = request.patch('/test_request') response = request.patch('/test_request')
expect(response).to be_a_redirect expect(response).to be_a_redirect
is_expected.to disallow_request expect(subject).to disallow_request
end end
it 'expects PUT requests to be disallowed' do it 'expects PUT requests to be disallowed' do
response = request.put('/test_request') response = request.put('/test_request')
expect(response).to be_a_redirect expect(response).to be_a_redirect
is_expected.to disallow_request expect(subject).to disallow_request
end end
it 'expects POST requests to be disallowed' do it 'expects POST requests to be disallowed' do
response = request.post('/test_request') response = request.post('/test_request')
expect(response).to be_a_redirect expect(response).to be_a_redirect
is_expected.to disallow_request expect(subject).to disallow_request
end end
it 'expects a internal POST request to be allowed after a disallowed request' do it 'expects a internal POST request to be allowed after a disallowed request' do
...@@ -80,7 +80,7 @@ describe Gitlab::Middleware::ReadonlyGeo do ...@@ -80,7 +80,7 @@ describe Gitlab::Middleware::ReadonlyGeo do
response = request.delete('/test_request') response = request.delete('/test_request')
expect(response).to be_a_redirect expect(response).to be_a_redirect
is_expected.to disallow_request expect(subject).to disallow_request
end end
context 'whitelisted requests' do context 'whitelisted requests' do
...@@ -88,28 +88,28 @@ describe Gitlab::Middleware::ReadonlyGeo do ...@@ -88,28 +88,28 @@ describe Gitlab::Middleware::ReadonlyGeo do
response = request.delete('/users/sign_out') response = request.delete('/users/sign_out')
expect(response).not_to be_a_redirect expect(response).not_to be_a_redirect
is_expected.not_to disallow_request expect(subject).not_to disallow_request
end end
it 'expects a POST internal request to be allowed' do it 'expects a POST internal request to be allowed' do
response = request.post("/api/#{API::API.version}/internal") response = request.post("/api/#{API::API.version}/internal")
expect(response).not_to be_a_redirect expect(response).not_to be_a_redirect
is_expected.not_to disallow_request expect(subject).not_to disallow_request
end end
it 'expects a GET status request to be allowed' do it 'expects a GET status request to be allowed' do
response = request.get("/api/#{API::API.version}/geo/status") response = request.get("/api/#{API::API.version}/geo/status")
expect(response).not_to be_a_redirect expect(response).not_to be_a_redirect
is_expected.not_to disallow_request expect(subject).not_to disallow_request
end end
it 'expects a POST LFS request to batch URL to be allowed' do it 'expects a POST LFS request to batch URL to be allowed' do
response = request.post('/root/rouge.git/info/lfs/objects/batch') response = request.post('/root/rouge.git/info/lfs/objects/batch')
expect(response).not_to be_a_redirect expect(response).not_to be_a_redirect
is_expected.not_to disallow_request expect(subject).not_to disallow_request
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