Commit 0ed681bd authored by Mike Kozono's avatar Mike Kozono

Remove extra space in 403 message

parent d0cef8ed
---
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
end
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
......
......@@ -372,7 +372,7 @@ module API
def forbidden!(reason = nil)
message = ['403 Forbidden']
message << " - #{reason}" if reason
message << "- #{reason}" if reason
render_api_error!(message.join(' '), 403)
end
......
......@@ -2368,7 +2368,7 @@ RSpec.describe API::Users do
activate
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')
end
end
......@@ -2382,7 +2382,7 @@ RSpec.describe API::Users do
activate
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')
end
end
......@@ -2439,7 +2439,7 @@ RSpec.describe API::Users do
deactivate
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')
end
end
......@@ -2467,7 +2467,7 @@ RSpec.describe API::Users do
deactivate
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')
end
end
......@@ -2481,7 +2481,7 @@ RSpec.describe API::Users do
deactivate
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')
end
end
......@@ -2493,7 +2493,7 @@ RSpec.describe API::Users do
deactivate
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
......
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