Browse Source

Add guidance link to an empty page

pull/2120/head
Kat 2 years ago
parent
commit
ba2e61b5f2
  1. 9
      app/views/layouts/_collection_resources.html.erb
  2. 7
      app/views/start/index.html.erb
  3. 10
      spec/requests/start_controller_spec.rb

9
app/views/layouts/_collection_resources.html.erb

@ -1,5 +1,12 @@
<h2 class="govuk-heading-m">Collection resources</h2> <h2 class="govuk-heading-m">Collection resources</h2>
<p class="govuk-body-s">Use the 2023 to 2024 forms for lettings that start and sales that complete between 1 April 2023 and 31 March 2024.</p> <% if current_user %>
<p class="govuk-body"><strong>
<%= govuk_link_to guidance_path do %>
Guidance for submitting social housing lettings and sales data (CORE)
<% end %>
</strong></p>
<% end %>
<p class="govuk-body">Use the 2023 to 2024 forms for lettings that start and sales that complete between 1 April 2023 and 31 March 2024.</p>
<%= govuk_tabs(title: "Monday’s child nursery rhyme") do |c| %> <%= govuk_tabs(title: "Monday’s child nursery rhyme") do |c| %>
<% if FormHandler.instance.lettings_form_for_start_year(2023) && FormHandler.instance.lettings_form_for_start_year(2023).edit_end_date > Time.zone.today %> <% if FormHandler.instance.lettings_form_for_start_year(2023) && FormHandler.instance.lettings_form_for_start_year(2023).edit_end_date > Time.zone.today %>
<% c.with_tab(label: "Lettings 2023/24") do %> <% c.with_tab(label: "Lettings 2023/24") do %>

7
app/views/start/index.html.erb

@ -23,3 +23,10 @@
<p class="govuk-body"><strong><%= govuk_link_to guidance_path do %>Guidance for submitting social housing lettings and sales data (CORE)<% end %></strong><p> <p class="govuk-body"><strong><%= govuk_link_to guidance_path do %>Guidance for submitting social housing lettings and sales data (CORE)<% end %></strong><p>
</div> </div>
</div> </div>
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render partial: "layouts/collection_resources" %>
</div>
</div>

10
spec/requests/start_controller_spec.rb

@ -20,6 +20,11 @@ RSpec.describe StartController, type: :request do
expect(path).to include("/") expect(path).to include("/")
expect(page).to have_content("Start now") expect(page).to have_content("Start now")
end end
it "does not show guidance link" do
get "/", headers: headers, params: {}
expect(page).not_to have_content("Guidance for submitting social housing lettings and sales data (CORE)")
end
end end
context "when the user is signed in" do context "when the user is signed in" do
@ -55,6 +60,11 @@ RSpec.describe StartController, type: :request do
expect(page).not_to have_content("Sales 2023/24") expect(page).not_to have_content("Sales 2023/24")
end end
end end
it "shows guidance link" do
get "/", headers: headers, params: {}
expect(page).to have_content("Guidance for submitting social housing lettings and sales data (CORE)")
end
end end
end end

Loading…
Cancel
Save