|
|
@ -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" } |
|
|
|
|
|
|
|
|
|
|
|