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

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