From ba2e61b5f22f21476330991000fa12cfb143c5bf Mon Sep 17 00:00:00 2001 From: Kat Date: Thu, 4 Jan 2024 12:18:57 +0000 Subject: [PATCH] Add guidance link to an empty page --- app/views/layouts/_collection_resources.html.erb | 9 ++++++++- app/views/start/index.html.erb | 7 +++++++ spec/requests/start_controller_spec.rb | 10 ++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/_collection_resources.html.erb b/app/views/layouts/_collection_resources.html.erb index ab7f2242e..0cfac27c1 100644 --- a/app/views/layouts/_collection_resources.html.erb +++ b/app/views/layouts/_collection_resources.html.erb @@ -1,5 +1,12 @@

Collection resources

-

Use the 2023 to 2024 forms for lettings that start and sales that complete between 1 April 2023 and 31 March 2024.

+<% if current_user %> +

+ <%= govuk_link_to guidance_path do %> + Guidance for submitting social housing lettings and sales data (CORE) + <% end %> +

+<% end %> +

Use the 2023 to 2024 forms for lettings that start and sales that complete between 1 April 2023 and 31 March 2024.

<%= 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 %> <% c.with_tab(label: "Lettings 2023/24") do %> diff --git a/app/views/start/index.html.erb b/app/views/start/index.html.erb index cb7b07a37..097d58d21 100644 --- a/app/views/start/index.html.erb +++ b/app/views/start/index.html.erb @@ -23,3 +23,10 @@

<%= govuk_link_to guidance_path do %>Guidance for submitting social housing lettings and sales data (CORE)<% end %>

+ +


+
+
+ <%= render partial: "layouts/collection_resources" %> +
+
diff --git a/spec/requests/start_controller_spec.rb b/spec/requests/start_controller_spec.rb index 979fa89d0..e97843d0a 100644 --- a/spec/requests/start_controller_spec.rb +++ b/spec/requests/start_controller_spec.rb @@ -20,6 +20,11 @@ RSpec.describe StartController, type: :request do expect(path).to include("/") expect(page).to have_content("Start now") 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 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") 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