Browse Source

remove base error for the schemes (#790)

pull/788/head^2
kosiakkatrina 2 years ago committed by GitHub
parent
commit
4a678a92af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/models/scheme.rb
  2. 2
      config/locales/en.yml
  3. 2
      spec/requests/schemes_controller_spec.rb

1
app/models/scheme.rb

@ -214,7 +214,6 @@ class Scheme < ApplicationRecord
if confirmed == true
required_attributes.any? do |attribute|
if self[attribute].blank?
errors.add :base
errors.add attribute.to_sym
self.confirmed = false
end

2
config/locales/en.yml

@ -65,8 +65,6 @@ en:
invalid: "Select if this scheme provides for another client group"
arrangement_type:
invalid: "Select who provides the support services used by this scheme"
base:
invalid: "You must answer all the required questions for this scheme"
location:
attributes:
startdate:

2
spec/requests/schemes_controller_spec.rb

@ -586,7 +586,7 @@ RSpec.describe SchemesController, type: :request do
it "does not allow the scheme to be confirmed" do
expect(response).to have_http_status(:unprocessable_entity)
expect(page).to have_content(I18n.t("activerecord.errors.models.scheme.attributes.base.invalid"))
expect(page).to have_content(I18n.t("activerecord.errors.models.scheme.attributes.managing_organisation_id.invalid"))
end
end

Loading…
Cancel
Save