diff --git a/app/models/scheme.rb b/app/models/scheme.rb index cbe10af1d..d7547bf36 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -163,7 +163,7 @@ class Scheme < ApplicationRecord end def appended_text - "(#{locations.count { |location| location.startdate.blank? || location.startdate <= Time.zone.today }} locations)" + "#{locations.count { |location| location.startdate.blank? || location.startdate <= Time.zone.today }} locations" end def hint diff --git a/spec/features/form/accessible_autocomplete_spec.rb b/spec/features/form/accessible_autocomplete_spec.rb index 309b732bf..1a9536d58 100644 --- a/spec/features/form/accessible_autocomplete_spec.rb +++ b/spec/features/form/accessible_autocomplete_spec.rb @@ -77,7 +77,7 @@ RSpec.describe "Accessible Automcomplete" do it "displays appended text next to the options", js: true do find("#case-log-scheme-id-field").click.native.send_keys("w", "6", :down, :enter) expect(find(".autocomplete__option__append", visible: :hidden, text: scheme.service_name)).to be_present - expect(find("span", visible: :hidden, text: /(2 locations)/)).to be_present + expect(find("span", visible: :hidden, text: "2 locations")).to be_present end it "displays hint text under the options", js: true do