Browse Source

Update flaky test (#1773)

pull/1768/head
kosiakkatrina 1 year ago committed by GitHub
parent
commit
483018be99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      spec/requests/lettings_logs_controller_spec.rb

14
spec/requests/lettings_logs_controller_spec.rb

@ -469,13 +469,13 @@ RSpec.describe LettingsLogsController, type: :request do
let(:bulk_upload) { create(:bulk_upload, :lettings, user:) } let(:bulk_upload) { create(:bulk_upload, :lettings, user:) }
let!(:included_log) { create(:lettings_log, :in_progress, bulk_upload:, owning_organisation: organisation) } let!(:included_log) { create(:lettings_log, :in_progress, bulk_upload:, owning_organisation: organisation) }
let!(:excluded_log) { create(:lettings_log, :in_progress, owning_organisation: organisation) } let!(:excluded_log) { create(:lettings_log, :in_progress, owning_organisation: organisation, tenancycode: "fake_code") }
it "returns logs only associated with the bulk upload" do it "returns logs only associated with the bulk upload" do
get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}"
expect(page).to have_content(included_log.id) expect(page).to have_content(included_log.id)
expect(page).not_to have_content(excluded_log.id) expect(page).not_to have_content(excluded_log.tenancycode)
end end
it "dislays how many logs remaining to fix" do it "dislays how many logs remaining to fix" do
@ -522,14 +522,16 @@ RSpec.describe LettingsLogsController, type: :request do
let(:other_user) { create(:user, organisation:) } let(:other_user) { create(:user, organisation:) }
let(:bulk_upload) { create(:bulk_upload, :lettings, user: other_user) } let(:bulk_upload) { create(:bulk_upload, :lettings, user: other_user) }
let!(:excluded_log) { create(:lettings_log, bulk_upload:, owning_organisation: organisation) } before do
let!(:also_excluded_log) { create(:lettings_log, owning_organisation: organisation) } create(:lettings_log, bulk_upload:, owning_organisation: organisation, tenancycode: "fake_code_1")
create(:lettings_log, owning_organisation: organisation, tenancycode: "fake_code_2")
end
it "does not return any logs" do it "does not return any logs" do
get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}" get "/lettings-logs?bulk_upload_id[]=#{bulk_upload.id}"
expect(page).not_to have_content(excluded_log.id) expect(page).not_to have_content("fake_code_1")
expect(page).not_to have_content(also_excluded_log.id) expect(page).not_to have_content("fake_code_2")
end end
end end

Loading…
Cancel
Save