Commit 65ea03ae authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch 'mk/remove-extra-space' into 'master'

Remove extra space in API 403 Forbidden error message

See merge request gitlab-org/gitlab!50016
parents 47fc384d 0ed681bd
---
title: Remove extra space in API 403 Forbidden error message
merge_request: 50016
author:
type: changed
...@@ -158,7 +158,7 @@ RSpec.describe API::VisualReviewDiscussions do ...@@ -158,7 +158,7 @@ RSpec.describe API::VisualReviewDiscussions do
end end
it 'returns error messaging specifying that the feature is disabled' do it 'returns error messaging specifying that the feature is disabled' do
expect(json_response['message']).to eq('403 Forbidden - Anonymous visual review feedback is disabled') expect(json_response['message']).to eq('403 Forbidden - Anonymous visual review feedback is disabled')
end end
end end
end end
......
...@@ -372,7 +372,7 @@ module API ...@@ -372,7 +372,7 @@ module API
def forbidden!(reason = nil) def forbidden!(reason = nil)
message = ['403 Forbidden'] message = ['403 Forbidden']
message << " - #{reason}" if reason message << "- #{reason}" if reason
render_api_error!(message.join(' '), 403) render_api_error!(message.join(' '), 403)
end end
......
...@@ -2368,7 +2368,7 @@ RSpec.describe API::Users do ...@@ -2368,7 +2368,7 @@ RSpec.describe API::Users do
activate activate
expect(response).to have_gitlab_http_status(:forbidden) expect(response).to have_gitlab_http_status(:forbidden)
expect(json_response['message']).to eq('403 Forbidden - A blocked user must be unblocked to be activated') expect(json_response['message']).to eq('403 Forbidden - A blocked user must be unblocked to be activated')
expect(user.reload.state).to eq('blocked') expect(user.reload.state).to eq('blocked')
end end
end end
...@@ -2382,7 +2382,7 @@ RSpec.describe API::Users do ...@@ -2382,7 +2382,7 @@ RSpec.describe API::Users do
activate activate
expect(response).to have_gitlab_http_status(:forbidden) expect(response).to have_gitlab_http_status(:forbidden)
expect(json_response['message']).to eq('403 Forbidden - A blocked user must be unblocked to be activated') expect(json_response['message']).to eq('403 Forbidden - A blocked user must be unblocked to be activated')
expect(user.reload.state).to eq('ldap_blocked') expect(user.reload.state).to eq('ldap_blocked')
end end
end end
...@@ -2439,7 +2439,7 @@ RSpec.describe API::Users do ...@@ -2439,7 +2439,7 @@ RSpec.describe API::Users do
deactivate deactivate
expect(response).to have_gitlab_http_status(:forbidden) expect(response).to have_gitlab_http_status(:forbidden)
expect(json_response['message']).to eq("403 Forbidden - The user you are trying to deactivate has been active in the past #{::User::MINIMUM_INACTIVE_DAYS} days and cannot be deactivated") expect(json_response['message']).to eq("403 Forbidden - The user you are trying to deactivate has been active in the past #{::User::MINIMUM_INACTIVE_DAYS} days and cannot be deactivated")
expect(user.reload.state).to eq('active') expect(user.reload.state).to eq('active')
end end
end end
...@@ -2467,7 +2467,7 @@ RSpec.describe API::Users do ...@@ -2467,7 +2467,7 @@ RSpec.describe API::Users do
deactivate deactivate
expect(response).to have_gitlab_http_status(:forbidden) expect(response).to have_gitlab_http_status(:forbidden)
expect(json_response['message']).to eq('403 Forbidden - A blocked user cannot be deactivated by the API') expect(json_response['message']).to eq('403 Forbidden - A blocked user cannot be deactivated by the API')
expect(user.reload.state).to eq('blocked') expect(user.reload.state).to eq('blocked')
end end
end end
...@@ -2481,7 +2481,7 @@ RSpec.describe API::Users do ...@@ -2481,7 +2481,7 @@ RSpec.describe API::Users do
deactivate deactivate
expect(response).to have_gitlab_http_status(:forbidden) expect(response).to have_gitlab_http_status(:forbidden)
expect(json_response['message']).to eq('403 Forbidden - A blocked user cannot be deactivated by the API') expect(json_response['message']).to eq('403 Forbidden - A blocked user cannot be deactivated by the API')
expect(user.reload.state).to eq('ldap_blocked') expect(user.reload.state).to eq('ldap_blocked')
end end
end end
...@@ -2493,7 +2493,7 @@ RSpec.describe API::Users do ...@@ -2493,7 +2493,7 @@ RSpec.describe API::Users do
deactivate deactivate
expect(response).to have_gitlab_http_status(:forbidden) expect(response).to have_gitlab_http_status(:forbidden)
expect(json_response['message']).to eq('403 Forbidden - An internal user cannot be deactivated by the API') expect(json_response['message']).to eq('403 Forbidden - An internal user cannot be deactivated by the API')
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