diff --git a/spec/models/scheme_spec.rb b/spec/models/scheme_spec.rb index 96c9b86a7..d81d93bd6 100644 --- a/spec/models/scheme_spec.rb +++ b/spec/models/scheme_spec.rb @@ -46,6 +46,10 @@ RSpec.describe Scheme, type: :model do end context "when searching by all searchable fields" do + before do + location_2.update!(postcode: location_2.postcode.gsub(scheme_1.id.to_s, "0")) + end + it "returns case insensitive matching records" do expect(described_class.search_by(scheme_1.id.to_s).count).to eq(1) expect(described_class.search_by(scheme_1.id.to_s).first.id).to eq(scheme_1.id) diff --git a/spec/requests/case_logs_controller_spec.rb b/spec/requests/case_logs_controller_spec.rb index f34f7bb66..eef4744d4 100644 --- a/spec/requests/case_logs_controller_spec.rb +++ b/spec/requests/case_logs_controller_spec.rb @@ -778,7 +778,7 @@ RSpec.describe CaseLogsController, type: :request do it "dowloads searched logs" do get "/logs?search=#{case_log.id}", headers:, params: {} csv = CSV.parse(response.body) - expect(csv.count).to eq(2) + expect(csv.count).to eq(CaseLog.search_by(case_log.id.to_s).count + 1) end context "when both filter and search applied" do