Skip to content

Commit

Permalink
Merge pull request #34 from hmrc/TAMC-1046
Browse files Browse the repository at this point in the history
Tamc 1046
  • Loading branch information
pankaj2453 authored Jun 16, 2016
2 parents 6b24808 + fd6de0d commit 06829ac
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 23 deletions.
2 changes: 2 additions & 0 deletions app/views/confirm.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,6 @@ <h1 id="confirm-page" class="heading-xlarge">@Html(Messages("pages.confirm.html.
<button data-journey-click="marriage-allowance:button:application_confirm" id="create" type="submit"> @Html(Messages("pages.confirm.button"))</button>
</p>
}
<br>
<a href="@controllers.routes.TransferController.confirmYourEmail" class="link-back">@Html(Messages("generic.back"))</a>
}
4 changes: 3 additions & 1 deletion app/views/date_of_marriage.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@ <h1 class="heading-xlarge">@Html(Messages("pages.date-of-marriage.heading"))</h1
<p class="get-started group" id="get-started">
<button class="button" type="submit" data-journey-click="marriage-allowance:button:dateofmarriage_continue">@Html(Messages("generic.continue"))</button>
</p>
}
}
<br>
<a href="@controllers.routes.TransferController.transfer" class="link-back">@Html(Messages("generic.back"))</a>
}
2 changes: 2 additions & 0 deletions app/views/eligible_years.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ <h3 class="heading-small">@Html(Messages("pages.eligibleyear.doyou.want"))</h3>
<button class="button" type="submit" data-journey-click="marriage-allowance:button:currentyear_continue">@Html(Messages("generic.continue"))</button>
</p>
}
<br>
<a href="@controllers.routes.TransferController.dateOfMarriage" class="link-back">@Html(Messages("generic.back"))</a>
}
4 changes: 3 additions & 1 deletion app/views/email.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ <h1 class="heading-xlarge">@Html(Messages("pages.form.field.your-confirmation"))
<button class="button" type="submit" data-journey-click="marriage-allowance:button:email_continue">@Html(Messages("generic.continue"))</button>
</p>
}
}
<br>
<a href="@controllers.routes.TransferController.previousYears" class="link-back">@Html(Messages("generic.back"))</a>
}
5 changes: 3 additions & 2 deletions app/views/errors/no_year_selected.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
@templates.tamc_main(
title = Messages("title.pattern", Messages("title.other-ways")),
mainConfig = views.helpers.MainConfig(
maybeMainDataAttributes = Some(Html("data-journey=marriage-allowance:stage:other-ways")))) {
maybeMainDataAttributes = Some(Html("data-journey=marriage-allowance:stage:other-ways")))) {
<h1 class="heading-xlarge text mainpage" id="message">You haven't selected any tax years to apply for</h1>
<div class="panel panel-border-narrow">Go back if you want to select a year to apply for.</div>
<p>You can find out more about <a href="https://www.gov.uk/marriage-allowance-guide/how-it-works">how Marriage Allowance works.</a></p>
<a href="@controllers.routes.TransferController.eligibleYears()" class="link-back">Back</a>
<br>
<a href="@controllers.routes.TransferController.eligibleYears" class="link-back">@Html(Messages("generic.back"))</a>
}
2 changes: 2 additions & 0 deletions app/views/multi_year_select.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,7 @@ <h2 class="heading-medium"><span style="color:grey">@TextGenerators.taxDateInter
<button class="button" type="submit" data-journey-click="marriage-allowance:button:previousyear_continue">@Html(Messages("generic.continue"))</button>
</p>
}
<br>
<a href="@controllers.routes.TransferController.eligibleYearsAction" class="link-back">@Html(Messages("generic.back"))</a>
}

3 changes: 2 additions & 1 deletion app/views/multiyear/gds/eligibility_check.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@templates.tamc_main(
title = Messages("title.pattern", Messages("title.eligibility"))){
@if(ApplicationConfig.isWelshEnabled){
@templates.lang_button(controllers.routes.LanguageController.switchToEnglishEligibilityCheck.toString(),
@templates.lang_button(controllers.routes.LanguageController.switchToEnglishEligibilityCheck.toString(),
controllers.routes.LanguageController.switchToWelshEligibilityCheck.toString())
}
<h1 class="heading-xlarge">
Expand Down Expand Up @@ -58,4 +58,5 @@ <h1 class="heading-xlarge">
</button>
</div>
}
<a href="https://www.gov.uk/apply-marriage-allowance" class="link-back">@Html(Messages("generic.back"))</a>
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,5 @@ <h1>@Html(Messages("eligibility.check.header"))</h1>
@Html(Messages("generic.finish"))
</a>
</p>
<a href="@controllers.routes.MultiYearGdsEligibilityController.eligibilityCheck" data-journey-click="marriage-allowance:click:back-on-to-eligibilitycheck" id="back">
@Html(Messages("generic.back"))
</a>
<a href="@controllers.routes.MultiYearGdsEligibilityController.eligibilityCheck" class="link-back">@Html(Messages("generic.back"))</a>
}

click
3 changes: 2 additions & 1 deletion app/views/multiyear/gds/lower_earner.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@if(ApplicationConfig.isWelshEnabled){
@templates.lang_button(controllers.routes.LanguageController.switchToEnglishLowerEarnerCheck.toString(),
controllers.routes.LanguageController.switchToWelshLowerEarnerCheck.toString())
}
}
<h1 class="heading-xlarge">
<span class="heading-large secondary-text-colour"> @Html(Messages("eligibility.check.span.h1"))</span><br/>
@Html(Messages("eligibility.check.lower.earner.h1"))</h1>
Expand Down Expand Up @@ -67,4 +67,5 @@ <h1 class="heading-xlarge">
</button>
</div>
}
<a href="@controllers.routes.MultiYearGdsEligibilityController.eligibilityCheck" class="link-back">@Html(Messages("generic.back"))</a>
}
3 changes: 2 additions & 1 deletion app/views/multiyear/gds/partners_income_question.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ <h1 class="heading-xlarge">
</div>

}
}
<a href="@controllers.routes.MultiYearGdsEligibilityController.lowerEarnerCheck" class="link-back">@Html(Messages("generic.back"))</a>
}
11 changes: 7 additions & 4 deletions app/views/previous_years.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@

@templates.tamc_main(
title = Messages("title.pattern", Messages("title.extra-years"))){
<h1 class="heading-xlarge" id="heading">@Html(Messages("pages.previousyear.header"))</h1>
<p class="lede">@Html(Messages("pages.previousyear.lede"))</p>
<h1 class="heading-xlarge" id="heading">@Html(Messages("pages.previousyear.header"))</h1>
<p class="lede">@Html(Messages("pages.previousyear.lede"))</p>


<p>@Html(Messages("pages.previousyear.para", input.name, TextGenerators.ukDateTransformer(Some(input.dateOfMarriage))))</p>
<a href="@{controllers.routes.TransferController.previousYears}" id="continue" class="button" type="submit" data-journey-click="marriage-allowance:button:previousyearlead_continue">@Html(Messages("generic.continue"))</a>
<p>@Html(Messages("pages.previousyear.para", input.name, TextGenerators.ukDateTransformer(Some(input.dateOfMarriage))))</p>
<a href="@{controllers.routes.TransferController.previousYears}" id="continue" class="button" type="submit" data-journey-click="marriage-allowance:button:previousyearlead_continue">@Html(Messages("generic.continue"))</a>
<br>
<br>
<a href="@controllers.routes.TransferController.eligibleYears" class="link-back">@Html(Messages("generic.back"))</a>
}

1 change: 1 addition & 0 deletions app/views/verify.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ <h1 class="heading-xlarge">@Html(Messages("pages.verify_triage.header"))</h1>
@Html(Messages("generic.start-now"))
</a>
</div>
<a href="@controllers.routes.MultiYearGdsEligibilityController.partnersIncomeCheck" class="link-back">@Html(Messages("generic.back"))</a>
}

2 changes: 1 addition & 1 deletion conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ pages.previousyear.lede=You can apply for Marriage Allowance from when it was fi
pages.previousyear.para=You told us you married or formed a civil partnership with <span id="firstNameOnly">{0}</span> on <span id="marriageDate">{1}</span>. This means you can apply for earlier tax years.

#confirm-page
pages.confirm.lower.earner=Your details(the lower earner)
pages.confirm.lower.earner=Your details (the lower earner)
pages.confirm.higher.earner=Your partner''s details (the higher earner)
pages.confirm.current.tax=Current tax year: {0} onwards
pages.confirm.current.tax.desc=HMRC will change your and {0} tax codes to save {1} up to £{2}. Marriage Allowance will automatically continue until you or {3} cancel it or are no longer eligible as a couple.
Expand Down
2 changes: 1 addition & 1 deletion conf/messages.cy
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ pages.previousyear.lede=CY_You can apply for Marriage Allowance from when it was
pages.previousyear.para=CY_You told us you married or formed a civil partnership with <span id="firstNameOnly">{0}</span> on <span id="marriageDate">{1}</span>. This means you can apply for earlier tax years.
#confirm-page
pages.confirm.lower.earner=CY_Your details(the lower earner)
pages.confirm.lower.earner=CY_Your details (the lower earner)
pages.confirm.higher.earner=CY_partner''s details (the higher earner)
pages.confirm.current.tax=CY_Current tax year: {0} onwards
pages.confirm.current.tax.desc=CY_HMRC will change your and {0} tax codes to save {1} up to £{2}. Marriage Allowance will automatically continue until you or {3} cancel it or are no longer eligible as a couple.
Expand Down
12 changes: 11 additions & 1 deletion test/controllers/ContentTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ class ContentTest extends UnitSpec with TestUtility {

val err = field.getElementsByClass("client-error-notification")
err.size() shouldBe 1

val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe marriageAllowanceUrl("/transfer-allowance")
}

"display form error message (date of marriage is after today's date)" in new WithApplication(fakeApplication) {
Expand Down Expand Up @@ -552,7 +556,9 @@ class ContentTest extends UnitSpec with TestUtility {
val document = Jsoup.parse(contentAsString(result))
document.getElementById("firstNameOnly").text() shouldBe "foo"
document.getElementById("marriageDate").text() shouldBe "10 April 2011"

val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe marriageAllowanceUrl("/eligible-years")
}
"display form error message (no year choice made )" in new WithApplication(fakeApplication) {

Expand Down Expand Up @@ -599,6 +605,10 @@ class ContentTest extends UnitSpec with TestUtility {
labelName.getElementsByClass("error-message").first() shouldNot be(null)
labelName.getElementsByClass("error-message").first().text() shouldBe "Tell us your email address."
document.getElementById("transferor-email-error").text() shouldBe "Confirm your email"

val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe marriageAllowanceUrl("/previous-years")
}

"display form error message (transferor email is empty)" in new WithApplication(fakeApplication) {
Expand Down
3 changes: 3 additions & 0 deletions test/controllers/MarriageAllowanceControllerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ class MarriageAllowanceControllerTest extends UnitSpec with TestUtility {

status(result) shouldBe OK
val document = Jsoup.parse(contentAsString(result))
val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe marriageAllowanceUrl("/date-of-marriage")
}

"show No Tax Years selected page if user is only eligible for current year and chooses no" in new WithApplication(fakeApplication) {
Expand Down
25 changes: 21 additions & 4 deletions test/controllers/RoutesTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ class RoutesTest extends UnitSpec with TestUtility {
continue shouldNot be(null)
continue.text() shouldBe "Start now"
continue.attr("href") shouldBe "/marriage-allowance-application/history"

val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe marriageAllowanceUrl("/partners-income")
}
}

Expand Down Expand Up @@ -337,6 +341,10 @@ class RoutesTest extends UnitSpec with TestUtility {
status(result) shouldBe OK
val document = Jsoup.parse(contentAsString(result))
document.getElementById("create").text() shouldBe "Confirm your application"

val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe marriageAllowanceUrl("/confirm-your-email")
}


Expand Down Expand Up @@ -828,9 +836,13 @@ class RoutesTest extends UnitSpec with TestUtility {
document.getElementById("form-error-message").text() shouldBe TestConstants.ERROR_MANDATORY_DATA_TEXT

document.getElementById("marriage-criteria-error").text() shouldBe "Confirm if you are married or in a legally registered civil partnership"

val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe ("https://www.gov.uk/apply-marriage-allowance")
}

"redirect to lower earner page if answer is yes" in new WithApplication(fakeApplication) {
"redirect to lower earner page if answer is yes and have back button" in new WithApplication(fakeApplication) {
val request = FakeRequest().withCookies(Cookie("TAMC_JOURNEY", "GDS")).withFormUrlEncodedBody("marriage-criteria" -> "true")
val controllerToTest = makeMultiYearGdsEligibilityController()
val result = controllerToTest.eligibilityCheckAction()(request)
Expand All @@ -850,9 +862,6 @@ class RoutesTest extends UnitSpec with TestUtility {
val finish = document.getElementById("button-finished")
finish shouldNot be(null)
finish.attr("href") shouldBe "https://www.gov.uk/marriage-allowance-guide"
val continue = document.getElementById("back")
continue shouldNot be(null)
continue.attr("href") shouldBe marriageAllowanceUrl("/eligibility-check")
}
}

Expand All @@ -870,6 +879,10 @@ class RoutesTest extends UnitSpec with TestUtility {
document.getElementById("form-error-message").text() shouldBe TestConstants.ERROR_MANDATORY_DATA_TEXT

document.getElementById("lower-earner-error").text shouldBe "Confirm if you are the lower earner in the relationship"

val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe marriageAllowanceUrl("/eligibility-check")
}

"redirect to who should transfer page irrespective of selection" in new WithApplication(fakeApplication) {
Expand All @@ -896,6 +909,10 @@ class RoutesTest extends UnitSpec with TestUtility {
document.getElementById("form-error-message").text() shouldBe TestConstants.ERROR_MANDATORY_DATA_TEXT

document.getElementsByClass("partners-inc-error").text shouldBe "You're not eligible for Marriage Allowance in this tax year because your partner's income is too high or too low. You can still continue to check your eligibility for previous years."

val back = document.getElementsByClass("link-back")
back shouldNot be(null)
back.attr("href") shouldBe marriageAllowanceUrl("/lower-earner")
}

"redirect to verify page irrespective of selection" in new WithApplication(fakeApplication) {
Expand Down

0 comments on commit 06829ac

Please sign in to comment.