possibly flaky test fix (#19856)

This commit is contained in:
PJ 2023-07-28 15:20:19 +01:00 committed by GitHub
parent 9754d14182
commit 6e7a898828
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -486,7 +486,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_20_211851) do
t.index ["exclude_article_ids"], name: "index_display_ads_on_exclude_article_ids", using: :gin
t.index ["placement_area"], name: "index_display_ads_on_placement_area"
t.index ["target_geolocations"], name: "gist_index_display_ads_on_target_geolocations", using: :gist
t.index ["target_geolocations"], name: "index_display_ads_on_target_geolocations"
end
create_table "email_authorizations", force: :cascade do |t|

View file

@ -151,6 +151,7 @@ RSpec.describe DisplayAds::FilteredAdsQuery, type: :query do
let(:organization) { create(:organization) }
let(:other_org) { create(:organization) }
let(:no_ads_org) { create(:organization) }
let!(:community_ad) { create_display_ad organization_id: organization.id, type_of: :community }
let!(:other_community) { create_display_ad organization_id: other_org.id, type_of: :community }
@ -162,7 +163,7 @@ RSpec.describe DisplayAds::FilteredAdsQuery, type: :query do
expect(filtered).to contain_exactly(community_ad)
expect(filtered).not_to include(other_community)
filtered = filter_ads organization_id: 123
filtered = filter_ads organization_id: no_ads_org.id
expect(filtered).to contain_exactly(in_house_ad)
expect(filtered).not_to include(other_community)