Browse Source

Use ‘scheme’ not ‘service’ for scheme search label (#687)

pull/690/head
Paul Robert Lloyd 3 years ago committed by GitHub
parent
commit
70eb5c05ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/views/organisations/schemes.html.erb
  2. 2
      app/views/schemes/index.html.erb
  3. 4
      spec/features/schemes_spec.rb
  4. 2
      spec/helpers/tab_nav_helper_spec.rb
  5. 2
      spec/models/scheme_spec.rb

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

@ -13,7 +13,7 @@
<h2 class="govuk-visually-hidden">Supported housing 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) %> <%= render SearchComponent.new(current_user:, search_label: "Search by scheme name or code", value: @searched) %>
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m"> <hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m">

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

@ -7,7 +7,7 @@
<h2 class="govuk-visually-hidden">Supported housing 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) %> <%= render SearchComponent.new(current_user:, search_label: "Search by scheme name or code", value: @searched) %>
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m"> <hr class="govuk-section-break govuk-section-break--visible govuk-section-break--m">

4
spec/features/schemes_spec.rb

@ -32,7 +32,7 @@ RSpec.describe "Schemes scheme Features" do
context "when I search for a specific scheme" do context "when I search for a specific scheme" do
it "there is a search bar with a message and search button for schemes" do it "there is a search bar with a message and search button for schemes" do
expect(page).to have_field("search") expect(page).to have_field("search")
expect(page).to have_content("Search by service name or code") expect(page).to have_content("Search by scheme name or code")
expect(page).to have_button("Search") expect(page).to have_button("Search")
end end
@ -105,7 +105,7 @@ RSpec.describe "Schemes scheme Features" do
context "when I search for a specific scheme" do context "when I search for a specific scheme" do
it "there is a search bar with a message and search button for schemes" do it "there is a search bar with a message and search button for schemes" do
expect(page).to have_field("search") expect(page).to have_field("search")
expect(page).to have_content("Search by service name or code") expect(page).to have_content("Search by scheme name or code")
expect(page).to have_button("Search") expect(page).to have_button("Search")
end end

2
spec/helpers/tab_nav_helper_spec.rb

@ -20,7 +20,7 @@ RSpec.describe TabNavHelper do
end end
describe "#scheme_cell" do describe "#scheme_cell" do
it "returns the scheme link service name and primary user group separated by a newline character" do it "returns the scheme link, name and primary user group separated by a newline character" do
expected_html = "<a class=\"govuk-link\" href=\"/schemes\">#{scheme.service_name}</a>\n<span class=\"govuk-visually-hidden\">Scheme </span><span class=\"govuk-!-font-weight-regular app-!-colour-muted\">#{scheme.primary_client_group_display}</span>" expected_html = "<a class=\"govuk-link\" href=\"/schemes\">#{scheme.service_name}</a>\n<span class=\"govuk-visually-hidden\">Scheme </span><span class=\"govuk-!-font-weight-regular app-!-colour-muted\">#{scheme.primary_client_group_display}</span>"
expect(scheme_cell(scheme)).to match(expected_html) expect(scheme_cell(scheme)).to match(expected_html)
end end

2
spec/models/scheme_spec.rb

@ -23,7 +23,7 @@ RSpec.describe Scheme, type: :model do
end end
end end
context "when searching by service name" do context "when searching by scheme name" do
it "returns case insensitive matching records" do it "returns case insensitive matching records" do
expect(described_class.search_by_service_name(scheme_1.service_name.upcase).count).to eq(1) expect(described_class.search_by_service_name(scheme_1.service_name.upcase).count).to eq(1)
expect(described_class.search_by_service_name(scheme_1.service_name.downcase).count).to eq(1) expect(described_class.search_by_service_name(scheme_1.service_name.downcase).count).to eq(1)

Loading…
Cancel
Save