return'This environment is not protected'unlessdeployment.environment.protected?
return_('This environment is not protected.')unlessdeployment.environment.protected?
return'You do not have permission to approve or reject this deployment'unlesscurrent_user&.can?(:update_deployment,deployment)
return_("You don't have permission to review this deployment. Contact the project or group owner for help.")unlesscurrent_user&.can?(:update_deployment,deployment)
return'This deployment job is not waiting for approvals'unlessdeployment.blocked?
return_('This deployment is not waiting for approvals.')unlessdeployment.blocked?
'The same user can not approve'ifdeployment.user==current_user&&status=='approved'
_('You cannot approve your own deployment.')ifdeployment.user==current_user&&status=='approved'
@@ -270,7 +270,7 @@ RSpec.describe API::Deployments do
end
context'and user is not authorized to update deployment'do
include_examples'not created',response_status: :bad_request,message: 'You do not have permission to approve or reject this deployment'
include_examples'not created',response_status: :bad_request,message: "You don't have permission to review this deployment. Contact the project or group owner for help."