Browse Source

fixed specs and no brackets

pull/768/head
JG 3 years ago
parent
commit
58743cd071
  1. 2
      app/models/scheme.rb
  2. 2
      spec/features/form/accessible_autocomplete_spec.rb

2
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

2
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

Loading…
Cancel
Save