confirmed:"Your email address has been successfully confirmed"
send_instructions:"You will receive an email with instructions for how to confirm your email address in a few minutes"
send_paranoid_instructions:"If your email address exists in our database, you will receive an email in a few minutes with instructions for how to confirm your email address"
confirmed:"Your email address has been successfully confirmed."
send_instructions:"You will receive an email with instructions for how to confirm your email address in a few minutes."
send_paranoid_instructions:"If your email address exists in our database, you will receive an email in a few minutes with instructions for how to confirm your email address."
failure:
already_authenticated:"You are already signed in"
inactive:"Your account has not been activated yet"
invalid:"Incorrect %{authentication_keys} or password"
already_authenticated:"You are already signed in."
inactive:"Your account has not been activated yet."
invalid:"Incorrect %{authentication_keys} or password."
locked:"Your account has been locked."
last_attempt:"You have one more attempt before your account is locked"
not_found_in_database:"Incorrect %{authentication_keys} or password"
last_attempt:"You have one more attempt before your account is locked."
not_found_in_database:"Incorrect %{authentication_keys} or password."
timeout:"Your session expired. Sign in again to continue."
unauthenticated:"You need to sign in or sign up before continuing"
unconfirmed:"You must confirm your email address before continuing"
unauthenticated:"You need to sign in or sign up before continuing."
unconfirmed:"You must confirm your email address before continuing."
mailer:
confirmation_instructions:
subject:"Confirmation instructions"
subject:"Confirmation instructions."
reset_password_instructions:
subject:"Reset password instructions"
subject:"Reset password instructions."
unlock_instructions:
subject:"Unlock instructions"
subject:"Unlock instructions."
email_changed:
subject:"Email successfully changed"
subject:"Email successfully changed."
password_change:
subject:"Password successfully changed"
subject:"Password successfully changed."
omniauth_callbacks:
failure:'We could not authenticate you from %{kind} because "%{reason}"'
success:"Successfully authenticated from %{kind} account"
success:"Successfully authenticated from %{kind} account."
passwords:
no_token:"You can’t access this page unless you’re trying to reset your password. Check you’re using the correct URL in the email we sent you."
send_instructions:"You will receive an email in a few minutes with instructions on how to reset your password"
send_paranoid_instructions:"If your email address exists in our database, you will receive an email in the next few minutes with a link to recover your password"
send_instructions:"You will receive an email in a few minutes with instructions on how to reset your password."
send_paranoid_instructions:"If your email address exists in our database, you will receive an email in the next few minutes with a link to recover your password."
updated:"Your password has been successfully changed. You are now signed in."
updated_2FA:"Your password has been successfully changed. We’ve sent you a security code."
updated_not_active:"Your password has been successfully changed"
updated_not_active:"Your password has been successfully changed."
registrations:
destroyed:"Your account has been successfully cancelled"
signed_up:"You have successfully signed up for an account"
destroyed:"Your account has been successfully cancelled."
signed_up:"You have successfully signed up for an account."
signed_up_but_inactive:"You have successfully signed up for an account. You won’t be able to sign in until your account is activated."
signed_up_but_locked:"You have successfully signed up for an account. We could not sign you in because your account is locked."
signed_up_but_unconfirmed:"We’ve sent a confirmation link to your email address. Follow the link to activate your account."
update_needs_confirmation:"You successfully updated your account. We need to verify your new email address. Check your email and follow the confirmation link to confirm your new email address."
updated:"Your account has been successfully updated"
updated:"Your account has been successfully updated."
updated_but_not_signed_in:"Your account has been successfully updated. You’ll need to sign in again."
sessions:
signed_in:""
signed_out:""
already_signed_out:""
unlocks:
send_instructions:"You will receive an email in a few minutes with instructions for how to unlock your account"
send_paranoid_instructions:"If your account exists, you will receive an email in a few minutes with instructions for how to unlock it"
send_instructions:"You will receive an email in a few minutes with instructions for how to unlock your account."
send_paranoid_instructions:"If your account exists, you will receive an email in a few minutes with instructions for how to unlock it."
unlocked:"Your account has been successfully unlocked. Sign in to continue."
activation:
deactivated:"%{user_name} account has been deactivated."
@ -65,8 +65,8 @@ en:
confirmation:"The passwords you entered do not match. Try again."
confirmation_period_expired:"Email needs to be confirmed within %{period}. Request a new link below."
expired:"Token has expired. Request a new token."
not_found:"was not found"
not_locked:"has not been locked"
not_found:"was not found."
not_locked:"has not been locked."
not_saved:
one:"One error stopped this %{resource} from being saved:"
other:"%{count} errors stopped this %{resource} from being saved:"
above_hard_max:"Rent is higher than the absolute maximum expected for a property of this type based on this period."
charges:
complete_1_of_3:"Answer either the ‘household rent and charges’ question or ‘is this accommodation a care home‘, or select ‘no’ for ‘does the household pay rent or charges for the accommodation?’"
missing_charges:"Please enter the %{question}. If there is no %{question}, please enter '0'."
missing_charges:"Please enter the %{sentence_fragment}. If there is no %{sentence_fragment}, please enter '0'."
tcharge:
under_10:"Enter a total charge that is at least £10.00 per week."
less_than_shortfall:"The total charge must be more than the outstanding amount."
@ -375,4 +375,94 @@ RSpec.describe Form::Question, type: :model do
end
end
end
describe"#error_display_label"do
let(:question_with_error_label_no_punctuation){described_class.new("address_line1_input",{"header"=>"address line 1","error_label"=>"address line 1"},page)}
let(:question_with_error_label_with_full_stop){described_class.new("address_line1_input",{"header"=>"address line 1","error_label"=>"address line 1."},page)}
let(:question_with_error_label_with_question_mark){described_class.new("address_line1_input",{"header"=>"address line 1","error_label"=>"address line 1?"},page)}
let(:question_with_error_label_with_brackets){described_class.new("address_line1_input",{"header"=>"address line 1","error_label"=>"(address line 1)"},page)}
let(:question_with_error_label_with_percentage){described_class.new("address_line1_input",{"header"=>"address line 1","error_label"=>"address line 1%"},page)}
let(:question_with_check_answer_label_no_punctuation){described_class.new("address_line1_input",{"header"=>"address line 1","check_answer_label"=>"address line 1"},page)}
let(:question_with_check_answer_label_with_full_stop){described_class.new("address_line1_input",{"header"=>"address line 1","check_answer_label"=>"address line 1."},page)}
let(:question_with_check_answer_label_with_question_mark){described_class.new("address_line1_input",{"header"=>"address line 1","check_answer_label"=>"address line 1?"},page)}
let(:question_with_check_answer_label_with_brackets){described_class.new("address_line1_input",{"header"=>"address line 1","check_answer_label"=>"(address line 1)"},page)}
let(:question_with_check_answer_label_with_percentage){described_class.new("address_line1_input",{"header"=>"address line 1","check_answer_label"=>"address line 1%"},page)}
let(:question_with_header_no_punctuation){described_class.new("address_line1_input",{"header"=>"address line 1"},page)}
let(:question_with_header_with_full_stop){described_class.new("address_line1_input",{"header"=>"address line 1."},page)}
let(:question_with_header_with_question_mark){described_class.new("address_line1_input",{"header"=>"address line 1?"},page)}
let(:question_with_header_with_brackets){described_class.new("address_line1_input",{"header"=>"(address line 1)"},page)}
let(:question_with_header_with_percentage){described_class.new("address_line1_input",{"header"=>"address line 1%"},page)}
@ -697,8 +697,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"fetches the question's check_answer_label if it exists"do
parser.valid?
expect(parser.errors[:field_19]).toeql(["You must answer address line 1"])
expect(parser.errors[:field_21]).toeql(["You must answer town or city"])
expect(parser.errors[:field_19]).toeql(["You must answer address line 1."])
expect(parser.errors[:field_21]).toeql(["You must answer town or city."])
end
end
end
@ -846,7 +846,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_5]).tobe_present
expect(parser.errors[:field_11]).toeq(["You must answer intermediate rent type"])
expect(parser.errors[:field_11]).toeq(["You must answer intermediate rent type."])
end
end
@ -857,7 +857,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_5]).tobe_present
expect(parser.errors[:field_11]).toeq(["You must answer intermediate rent type"])
expect(parser.errors[:field_11]).toeq(["You must answer intermediate rent type."])
end
end
@ -868,7 +868,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_5]).tobe_present
expect(parser.errors[:field_10]).toeq(["You must answer is this a London Affordable Rent letting"])
expect(parser.errors[:field_10]).toeq(["You must answer is this a London Affordable Rent letting."])
end
end
@ -879,7 +879,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_5]).tobe_present
expect(parser.errors[:field_10]).toeq(["You must answer is this a London Affordable Rent letting"])
expect(parser.errors[:field_10]).toeq(["You must answer is this a London Affordable Rent letting."])
end
end
@ -888,7 +888,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds error on field_12"do
parser.valid?
expect(parser.errors[:field_12]).toeq(["You must answer product name"])
expect(parser.errors[:field_12]).toeq(["You must answer product name."])
end
end
@ -951,7 +951,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).toeq(["You must answer scheme code"])
expect(parser.errors[:field_16]).toeq(["You must answer scheme code."])
expect(parser.errors[:field_17]).tobe_blank
end
end
@ -992,7 +992,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors.where(:field_17,category::setup).map(&:message)).toeq(["You must answer location code"])
expect(parser.errors.where(:field_17,category::setup).map(&:message)).toeq(["You must answer location code."])
expect(parser.errors[:field_17].count).toeq(1)
end
end
@ -1005,7 +1005,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["You must answer management group code"])
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["You must answer management group code."])
expect(parser.errors[:field_15].count).toeq(1)
end
end
@ -1093,7 +1093,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).toinclude("You must answer scheme name")
expect(parser.errors[:field_16]).toinclude("You must answer scheme name.")
expect(parser.errors[:field_17]).tobe_blank
end
end
@ -1135,7 +1135,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["You must answer scheme code"])
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["You must answer scheme code."])
expect(parser.errors[:field_17]).tobe_blank
end
end
@ -1212,7 +1212,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"clears the scheme answer"do
parser.valid?
expect(parser.errors[:field_15]).toinclude("You must answer scheme name")
expect(parser.errors[:field_15]).toinclude("You must answer scheme name.")
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
end
@ -1255,7 +1255,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns an error"do
parser.valid?
expect(parser.errors[:field_102]).toinclude("Enter a valid value for What is the tenant’s main reason for the household leaving their last settled home?")
expect(parser.errors[:field_102]).toinclude("Enter a valid value for what is the tenant’s main reason for the household leaving their last settled home?")
end
end
end
@ -1527,7 +1527,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"is not permitted as setup error"do
parser.valid?
expect(parser.errors.where(:field_1,category::setup).map(&:message)).toeql(["You must answer owning organisation"])
expect(parser.errors.where(:field_1,category::setup).map(&:message)).toeql(["You must answer owning organisation."])
end
it"blocks log creation"do
@ -1692,7 +1692,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"is reported as a setup error"do
parser.valid?
expect(parser.errors.where(:field_4,category::setup).map(&:message)).toeql(["You must answer needs type"])
expect(parser.errors.where(:field_4,category::setup).map(&:message)).toeql(["You must answer needs type."])
end
end
end
@ -1703,7 +1703,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"has setup errors on the field"do
parser.valid?
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toeql(["You must answer property renewal"])
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toeql(["You must answer property renewal."])
end
end
@ -1712,7 +1712,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds a setup error"do
parser.valid?
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toinclude("Enter a valid value for Is this letting a renewal?")
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toinclude("Enter a valid value for is this letting a renewal?")
end
end
end
@ -1723,7 +1723,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an appropriate error"do
parser.valid?
expect(parser.errors[:field_18]).toeql(["UPRN is not recognised. Check the number, or enter the address"])
expect(parser.errors[:field_18]).toeql(["UPRN is not recognised. Check the number, or enter the address."])
end
end
@ -1733,9 +1733,9 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds appropriate errors"do
parser.valid?
expect(parser.errors[:field_18]).toeql(["You must answer UPRN"])
expect(parser.errors[:field_19]).toeql(["You must answer address line 1"])
expect(parser.errors[:field_21]).toeql(["You must answer town or city"])
expect(parser.errors[:field_18]).toeql(["You must answer UPRN."])
expect(parser.errors[:field_19]).toeql(["You must answer address line 1."])
expect(parser.errors[:field_21]).toeql(["You must answer town or city."])
end
end
@ -1811,7 +1811,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"populates with correct error message"do
parser.valid?
expect(parser.errors[:field_30]).toeql(["You must answer type of building"])
expect(parser.errors[:field_30]).toeql(["You must answer type of building."])
end
end
end
@ -2160,7 +2160,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_116]).toinclude("Enter a valid value for was the letting made under the Choice-Based Lettings (CBL)")
expect(parser.errors[:field_116]).toinclude("Enter a valid value for was the letting made under the Choice-Based Lettings (CBL)?")
end
end
end
@ -2187,7 +2187,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_118]).toinclude("Enter a valid value for was the letting made under the Common Housing Register (CHR)")
expect(parser.errors[:field_118]).toinclude("Enter a valid value for was the letting made under the Common Housing Register (CHR)?")
end
end
end
@ -2214,7 +2214,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error"do
parser.valid?
expect(parser.errors[:field_117]).toinclude("Enter a valid value for was the letting made under the Common Allocation Policy (CAP)")
expect(parser.errors[:field_117]).toinclude("Enter a valid value for was the letting made under the Common Allocation Policy (CAP)?")
expect(parser.errors[:field_5]).toinclude("You must answer scheme name")
expect(parser.errors[:field_5]).toinclude("You must answer scheme name.")
expect(parser.errors[:field_6]).tobe_blank
end
end
@ -1091,7 +1091,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns an error"do
parser.valid?
expect(parser.errors[:field_98]).toinclude("Enter a valid value for What is the tenant’s main reason for the household leaving their last settled home?")
expect(parser.errors[:field_98]).toinclude("Enter a valid value for what is the tenant’s main reason for the household leaving their last settled home?")
end
end
end
@ -1358,7 +1358,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"is not permitted as setup error"do
parser.valid?
expect(parser.errors.where(:field_1,category::setup).map(&:message)).toeql(["You must answer owning organisation"])
expect(parser.errors.where(:field_1,category::setup).map(&:message)).toeql(["You must answer owning organisation."])
end
it"blocks log creation"do
@ -1514,7 +1514,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do