Browse Source

supported housing to schemes - part 3

pull/662/head
JG 3 years ago
parent
commit
e01bf5fa6e
  1. 4
      app/views/organisations/schemes.html.erb
  2. 6
      app/views/schemes/index.html.erb
  3. 6
      spec/requests/organisations_controller_spec.rb
  4. 10
      spec/requests/schemes_controller_spec.rb

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

@ -1,5 +1,5 @@
<% item_label = format_label(@pagy.count, "scheme") %>
<% title = format_title(@searched, "Schemes", current_user, item_label, @pagy.count, @organisation.name) %>
<% title = format_title(@searched, "Supported housing schemes", current_user, item_label, @pagy.count, @organisation.name) %>
<% content_for :title, title %>
@ -11,7 +11,7 @@
) %>
<% end %>
<h2 class="govuk-visually-hidden">Schemes</h2>
<h2 class="govuk-visually-hidden">Supported housing schemes</h2>
<%= render SearchComponent.new(current_user:, search_label: "Search by service name or code", value: @searched) %>

6
app/views/schemes/index.html.erb

@ -1,11 +1,11 @@
<% item_label = format_label(@pagy.count, "scheme") %>
<% title = format_title(@searched, "Schemes", current_user, item_label, @pagy.count, nil) %>
<% title = format_title(@searched, "Supported housing schemes", current_user, item_label, @pagy.count, nil) %>
<% content_for :title, title %>
<%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Schemes", sub: nil } : { main: "Schemes", sub: current_user.organisation.name } %>
<%= render partial: "organisations/headings", locals: current_user.support? ? { main: "Supported housing schemes", sub: nil } : { main: "Supported housing schemes", sub: current_user.organisation.name } %>
<h2 class="govuk-visually-hidden">Schemes</h2>
<h2 class="govuk-visually-hidden">Supported housing schemes</h2>
<%= render SearchComponent.new(current_user:, search_label: "Search by service name or code", value: @searched) %>

6
spec/requests/organisations_controller_spec.rb

@ -60,7 +60,7 @@ RSpec.describe OrganisationsController, type: :request do
end
it "has hidden accebility field with description" do
expected_field = "<h2 class=\"govuk-visually-hidden\">Schemes</h2>"
expected_field = "<h2 class=\"govuk-visually-hidden\">Supported housing schemes</h2>"
expect(CGI.unescape_html(response.body)).to include(expected_field)
end
@ -116,7 +116,7 @@ RSpec.describe OrganisationsController, type: :request do
end
it "has hidden accessibility field with description" do
expected_field = "<h2 class=\"govuk-visually-hidden\">Schemes</h2>"
expected_field = "<h2 class=\"govuk-visually-hidden\">Supported housing schemes</h2>"
expect(CGI.unescape_html(response.body)).to include(expected_field)
end
@ -159,7 +159,7 @@ RSpec.describe OrganisationsController, type: :request do
end
it "has search in the title" do
expect(page).to have_title("Schemes (1 scheme matching ‘#{search_param}’) - Submit social housing lettings and sales data (CORE) - GOV.UK")
expect(page).to have_title("Supported housing schemes (1 scheme matching ‘#{search_param}’) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
end
end

10
spec/requests/schemes_controller_spec.rb

@ -65,7 +65,7 @@ RSpec.describe SchemesController, type: :request do
end
it "has correct title" do
expect(page).to have_title("Schemes - Submit social housing lettings and sales data (CORE) - GOV.UK")
expect(page).to have_title("Supported housing schemes - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
it "shows the total organisations count" do
@ -73,7 +73,7 @@ RSpec.describe SchemesController, type: :request do
end
it "has hidden accebility field with description" do
expected_field = "<h2 class=\"govuk-visually-hidden\">Schemes</h2>"
expected_field = "<h2 class=\"govuk-visually-hidden\">Supported housing schemes</h2>"
expect(CGI.unescape_html(response.body)).to include(expected_field)
end
@ -98,7 +98,7 @@ RSpec.describe SchemesController, type: :request do
end
it "has correct page 1 of 2 title" do
expect(page).to have_title("Schemes (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
expect(page).to have_title("Supported housing schemes (page 1 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
it "has pagination links" do
@ -130,7 +130,7 @@ RSpec.describe SchemesController, type: :request do
end
it "has correct page 1 of 2 title" do
expect(page).to have_title("Schemes (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
expect(page).to have_title("Supported housing schemes (page 2 of 2) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
end
end
@ -155,7 +155,7 @@ RSpec.describe SchemesController, type: :request do
end
it "has search in the title" do
expect(page).to have_title("Schemes (1 scheme matching ‘#{search_param}’) - Submit social housing lettings and sales data (CORE) - GOV.UK")
expect(page).to have_title("Supported housing schemes (1 scheme matching ‘#{search_param}’) - Submit social housing lettings and sales data (CORE) - GOV.UK")
end
end
end

Loading…
Cancel
Save