Browse Source

links on the page

pull/662/head
JG 3 years ago
parent
commit
674e4cce9c
  1. 7
      app/helpers/navigation_items_helper.rb
  2. 4
      app/views/schemes/show.html.erb
  3. 4
      spec/features/schemes_spec.rb

7
app/helpers/navigation_items_helper.rb

@ -34,6 +34,13 @@ module NavigationItemsHelper
]
end
def scheme_items(path, current_scheme_id)
[
NavigationItem.new("Scheme", "/supported-housing/#{current_scheme_id}", true),
NavigationItem.new("Locations", "/supported-housing/#{current_scheme_id}/locations", false),
]
end
private
def logs_current?(path)

4
app/views/schemes/show.html.erb

@ -3,6 +3,10 @@
<%= render partial: "organisations/headings", locals: { main: @scheme.service_name, sub: nil } %>
<%= render SubNavigationComponent.new(
items: scheme_items(request.path, @scheme.id),
) %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= govuk_summary_list do |summary_list| %>

4
spec/features/schemes_spec.rb

@ -130,8 +130,8 @@ RSpec.describe "Supported housing scheme Features" do
end
it "shows service and locations tab" do
expect(page).to have_content("Service")
expect(page).to have_content("locations")
expect(page).to have_link("Service")
expect(page).to have_link("#{schemes.count} locations")
end
end
end

Loading…
Cancel
Save