diff --git a/test/controllers/forms/AssistanceFormSpec.scala b/test/controllers/forms/AssistanceFormSpec.scala index d938389..92077c7 100644 --- a/test/controllers/forms/AssistanceFormSpec.scala +++ b/test/controllers/forms/AssistanceFormSpec.scala @@ -51,19 +51,19 @@ class AssistanceFormSpec extends BaseSpec { trait Fixture { val noDisabilities = { - val data = Data("No", Some(List("")), None, Some("No"), "No", None, None, None, None) + val data = Data("No", Some(List("")), None, Some("No"), "No", None, None) (data, AssistanceForm.form.fill(data)) } val noAdjustments = { - val data = Data("Yes", Some(List("One of the disabilities")), None, None, "No", None, None, None, None) + val data = Data("Yes", Some(List("One of the disabilities")), None, None, "No", None, None) (data, AssistanceForm.form.fill(data)) } val fullForm: (Data, Form[Data]) = { - val data = Data("Yes", Some(List("One of the disabilities")), Some("some details"), None, "Yes", Some(List("other")), None, None, None) + val data = Data("Yes", Some(List("One of the disabilities")), Some("some details"), None, "Yes", Some(List("other")), None) (data, AssistanceForm.form.fill(data)) } @@ -79,7 +79,7 @@ class AssistanceFormSpec extends BaseSpec { ) = { val data = Data(needsAssistance, typeOfdisability, detailsOfdisability, guaranteedInterview, needsAdjustment, - typeOfAdjustments, otherAdjustments, None, None) + typeOfAdjustments, otherAdjustments) (data, AssistanceForm.form.fill(data)) } diff --git a/test/controllers/forms/SignUpFormSpec.scala b/test/controllers/forms/SignUpFormSpec.scala index 5d5166e..85b3c17 100644 --- a/test/controllers/forms/SignUpFormSpec.scala +++ b/test/controllers/forms/SignUpFormSpec.scala @@ -72,14 +72,14 @@ class SignUpFormSpec extends BaseSpec { signUpForm.errors("password").head.messages must be(Seq(Messages("error.password"))) } - "throw an error if I haven't click on the I am eligible" in { + "throw an error if I haven't clicked on the I am eligible" in { val (_, signUpForm) = SignupFormGenerator(agreeEligibleToApply = false).get signUpForm.hasErrors must be(true) signUpForm.errors.length must be(1) signUpForm.errors("agreeEligibleToApply").head.messages must be(Seq(Messages("agree.eligible"))) } - "throw an error if I haven't click on the I agree" in { + "throw an error if I haven't clicked on the I agree" in { val (_, signUpForm) = SignupFormGenerator(agree = false).get signUpForm.hasErrors must be(true) signUpForm.errors.length must be(1) @@ -105,10 +105,14 @@ case class SignupFormGenerator( password: String = "aA1234567", confirm: String = "aA1234567", agree: Boolean = true, - agreeEligibleToApply: Boolean = true + agreeEligibleToApply: Boolean = true, + campaignReferrer: Option[String] = Some("Google"), + campaignOther: Option[String] = Some("More Google") ) { - private val data = Data(firstName, lastName, email, confirmEmail, password, confirm, agree, agreeEligibleToApply) + private val data = Data(firstName, lastName, email, confirmEmail, password, confirm, agree, agreeEligibleToApply, + campaignReferrer, campaignOther + ) private val validFormData = Map( "firstName" -> data.firstName, @@ -118,7 +122,10 @@ case class SignupFormGenerator( "password" -> data.password, "confirmpwd" -> data.confirmpwd, "agree" -> data.agree.toString, - "agreeEligibleToApply" -> data.agreeEligibleToApply.toString + "agreeEligibleToApply" -> data.agreeEligibleToApply.toString, + "campaignReferrer" -> data.campaignReferrer.getOrElse(""), + "campaignOther" -> data.campaignOther.getOrElse("") + ) private def signUpForm = Form(SignUpForm.form.mapping).bind(validFormData)