Browse Source

Update error copy

pull/1580/head
Jack S 3 years ago
parent
commit
5af8277678
  1. 2
      app/controllers/merge_requests_controller.rb
  2. 1
      config/locales/en.yml
  3. 2
      spec/requests/merge_requests_controller_spec.rb

2
app/controllers/merge_requests_controller.rb

@ -116,7 +116,7 @@ private
def validate_response
if page == "absorbing_organisation" && merge_request_params[:absorbing_organisation_id].blank? && merge_request_params[:new_absorbing_organisation].blank?
@merge_request.errors.add(:absorbing_organisation_id, "Select an option")
@merge_request.errors.add(:absorbing_organisation_id, I18n.t("validations.merge_request.absorbing_organisation_blank"))
render previous_template
end
end

1
config/locales/en.yml

@ -512,6 +512,7 @@ en:
merge_request:
organisation_part_of_another_merge: "This organisation is part of another merge - select a different one"
organisation_not_selected: "Select an organisation from the search list"
absorbing_organisation_blank: Select the organisation absorbing the others
soft_validations:
net_income:

2
spec/requests/merge_requests_controller_spec.rb

@ -272,7 +272,7 @@ RSpec.describe MergeRequestsController, type: :request do
it "renders the error" do
request
expect(page).to have_content("Select an option")
expect(page).to have_content("Select the organisation absorbing the others")
end
it "does not update the request" do

Loading…
Cancel
Save