Browse Source

scope to search by id

pull/608/head
JG 3 years ago
parent
commit
12132a861f
  1. 6
      spec/models/case_log_spec.rb

6
spec/models/case_log_spec.rb

@ -1871,6 +1871,12 @@ RSpec.describe CaseLog do
FactoryBot.create(:case_log, startdate: Time.utc(2022, 6, 3)) FactoryBot.create(:case_log, startdate: Time.utc(2022, 6, 3))
end end
context "when searching by" do
it "allows searching by a log ID" do
expect(described_class.search_by_id(case_log_1.id).count).to eq(1)
end
end
context "when filtering by year" do context "when filtering by year" do
it "allows filtering on a single year" do it "allows filtering on a single year" do
expect(described_class.filter_by_years(%w[2021]).count).to eq(2) expect(described_class.filter_by_years(%w[2021]).count).to eq(2)

Loading…
Cancel
Save