diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index 809820c96..047925722 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 12738ad93..80f6a9002 100644 --- a/config/locales/en.yml +++ b/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: diff --git a/spec/requests/merge_requests_controller_spec.rb b/spec/requests/merge_requests_controller_spec.rb index 4c6bb7979..5e2479189 100644 --- a/spec/requests/merge_requests_controller_spec.rb +++ b/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