Browse Source

Filter on the subset of logs in tests (#1430)

pull/1431/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
e2032edd88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      spec/services/filter_service_spec.rb

18
spec/services/filter_service_spec.rb

@ -29,13 +29,12 @@ describe FilterService do
context "when filtering logs" do context "when filtering logs" do
context "when filtering lettings logs" do context "when filtering lettings logs" do
before do let(:lettings_log_list) do
FactoryBot.create_list(:lettings_log, 5) logs = FactoryBot.create_list(:lettings_log, 5)
FactoryBot.create(:lettings_log, postcode_full: "SW1 1AA") searched_log = FactoryBot.create(:lettings_log, postcode_full: "SW1 1AA")
LettingsLog.where(id: [searched_log.id] + logs.map(&:id))
end end
let(:lettings_log_list) { LettingsLog.all }
context "when given a postcode" do context "when given a postcode" do
let(:search_term) { "SW1 1AA" } let(:search_term) { "SW1 1AA" }
@ -54,13 +53,12 @@ describe FilterService do
end end
context "when filtering sales logs" do context "when filtering sales logs" do
before do let(:sales_log_list) do
FactoryBot.create_list(:sales_log, 5) logs = FactoryBot.create_list(:sales_log, 5)
FactoryBot.create(:sales_log, purchid: "2") searched_log = FactoryBot.create(:sales_log, purchid: "2")
SalesLog.where(id: [searched_log.id] + logs.map(&:id))
end end
let(:sales_log_list) { SalesLog.all }
context "when given a purchid" do context "when given a purchid" do
let(:search_term) { "2" } let(:search_term) { "2" }

Loading…
Cancel
Save