Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class LandlordController @Inject()(view: LandlordView,
formWithErrors =>
val correctedFormErrors = formWithErrors.errors.map { formError =>
(formError.key, formError.messages) match
case ("", messages) if messages.contains("landlord.radio.empty.error") =>
case ("", messages) if messages.contains("landlord.radio.emptyText.error") =>
formError.copy(key = "landlord-relationship")
case ("", messages) if messages.contains("landlord.radio.tooLong.error") =>
formError.copy(key = "landlord-relationship")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object LandlordForm extends CommonFormValidators with Mappings{
private lazy val landlordNameEmptyError = "landlord.name.empty.error"
private lazy val landlordNameTooLongError = "landlord.name.empty.tooLong.error"
private lazy val radioUnselectedError = "landlord.radio.empty.error"
private lazy val landlordRelationshipEmptyError = "landlord.radio.empty.error"
private lazy val landlordRelationshipEmptyError = "landlord.radio.emptyText.error"
private lazy val landlordRelationshipTooLongError = "landlord.radio.tooLong.error"

private val landlord = "landlord-name-value"
Expand Down
6 changes: 3 additions & 3 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ typeOfLeaseRenewal.required.error = Select what type of lease renewal it is
#Landlord
landlord.title = Landlord
landlord.p1 = What is the landlord''s full name?
landlord.p2 = What is your relationship with the landlord?
landlord.p2 = Do you have a relationship with the landlord other than as a tenant?
landlord.name.empty.error = Enter the landlord''s full name
landlord.name.empty.tooLong.error = Landlord''s full name must be 50 characters or less
landlord.radio.empty.error = Select what your relationship with the landlord is
landlord.radio.empty.error = Tell us what your relationship with the landlord is
landlord.radio.empty.error = Select yes if you have any relationship with landlord
landlord.radio.emptyText.error = Tell us what your relationship with the landlord is
landlord.radio.tooLong.error = Maximum character allowed is 250
landlord.radio.yes = Can you tell us what your relationship with the landlord is?
landlord.radio.yes.hint = For example, the landlord is a family member, business partner, shared director or company pension fund
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class LandlordFormSpec extends AnyFlatSpec with Matchers {

val boundForm = LandlordForm.form.bind(data)

boundForm.errors shouldBe List(FormError("", List("landlord.radio.empty.error"), List()))
boundForm.errors shouldBe List(FormError("", List("landlord.radio.emptyText.error"), List()))
}

it should "pass when 'Yes' is selected and description is provided" in {
Expand Down