Skip to content

Commit

Permalink
EY practitioner enter home address
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Sep 27, 2024
1 parent eee7d70 commit 8ad7eed
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 28 deletions.
3 changes: 2 additions & 1 deletion app/models/journeys/early_years_payment/practitioner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module Practitioner
POLICIES = [Policies::EarlyYearsPayments]
FORMS = {
"claims" => {
"find-reference" => FindReferenceForm
"find-reference" => FindReferenceForm,
"enter-home-address" => AddressForm
}
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class SlugSequence
how-we-use-your-information
personal-details
enter-home-address
email-address
].freeze

def self.start_page_url
Expand Down
26 changes: 26 additions & 0 deletions app/views/claims/_address_fields.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<%= f.govuk_text_field :address_line_1,
autocomplete: "address-line1",
label: {
text: "#{t('forms.address.answers.address_line_1')}<span class=\"govuk-visually-hidden\">#{ t('forms.address.answers.address_line_1_visually_hidden')}</span>".html_safe
} %>

<%= f.govuk_text_field :address_line_2,
autocomplete: "address-line2",
label: {
text: "#{t('forms.address.answers.address_line_2')}<span class=\"govuk-visually-hidden\">#{ t('forms.address.answers.address_line_2_visually_hidden')}</span>".html_safe
} %>

<%= f.govuk_text_field :address_line_3,
width: "two-thirds",
autocomplete: "address-level2",
label: { text: t("forms.address.answers.address_line_3") } %>

<%= f.govuk_text_field :address_line_4,
width: "two-thirds",
autocomplete: "off",
label: { text: t("forms.address.answers.address_line_4") } %>

<%= f.govuk_text_field :postcode,
width: 10,
autocomplete: "postal-code",
label: { text: t("forms.address.answers.postcode") } %>
27 changes: 1 addition & 26 deletions app/views/claims/address.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,7 @@
text: t("questions.personal_details"),
size: "xl"
} do %>
<%= f.govuk_text_field :address_line_1,
autocomplete: "address-line1",
label: {
text: "#{t('forms.address.answers.address_line_1')}<span class=\"govuk-visually-hidden\">#{ t('forms.address.answers.address_line_1_visually_hidden')}</span>".html_safe
} %>

<%= f.govuk_text_field :address_line_2,
autocomplete: "address-line2",
label: {
text: "#{t('forms.address.answers.address_line_2')}<span class=\"govuk-visually-hidden\">#{ t('forms.address.answers.address_line_2_visually_hidden')}</span>".html_safe
} %>

<%= f.govuk_text_field :address_line_3,
width: "two-thirds",
autocomplete: "address-level2",
label: { text: t("forms.address.answers.address_line_3") } %>

<%= f.govuk_text_field :address_line_4,
width: "two-thirds",
autocomplete: "off",
label: { text: t("forms.address.answers.address_line_4") } %>

<%= f.govuk_text_field :postcode,
width: 10,
autocomplete: "postal-code",
label: { text: t("forms.address.answers.postcode") } %>
<%= render "address_fields", f: f %>
<% end %>

<%= f.govuk_submit "Continue" %>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="govuk-body">email address page goes here</p>
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
<p class="govuk-body">enter home address page goes here</p>
<% content_for(:page_title, page_title(t("forms.address.questions.your_address"), journey: current_journey_routing_name, show_error: @form.errors.any?)) %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= form_for @form, url: claim_path(current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_error_summary %>

<%= f.govuk_fieldset legend: {
text: t("forms.address.questions.your_address"),
tag: "h1",
size: "l"
} do %>
<%= render "address_fields", f: f %>
<% end %>

<%= f.govuk_submit "Continue" %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,14 @@
fill_in "Year", with: "1988"
fill_in "National Insurance number", with: "PX321499A"
click_on "Continue"

expect(page.title).to have_text("What is your address?")
expect(page).to have_content("What is your address?")
fill_in "House number or name", with: "57"
fill_in "Building and street", with: "Walthamstow Drive"
fill_in "Town or city", with: "Derby"
fill_in "County", with: "City of Derby"
fill_in "Postcode", with: "DE22 4BS"
click_on "Continue"
end
end

0 comments on commit 8ad7eed

Please sign in to comment.