Fix flaky test

Events can be any type, and some types can have identical ids. Thus asserting on ids only is brittle. Filtering for work packages and then testing ids fixes the flakiness.
pull/11861/head
Christophe Bliard 2 years ago
parent 48889e4699
commit 556f2d57da
No known key found for this signature in database
GPG Key ID: 2BC07603210C3FA4
  1. 2
      spec/models/activities/fetcher_integration_spec.rb

@ -206,7 +206,7 @@ describe Activities::Fetcher, 'integration' do
# project attributes and news only require the user to be member
expect(subject.map(&:journable_id))
.to match_array([project.id, subproject.id, news.id, subproject_news.id, work_package.id])
expect(subject.map(&:journable_id))
expect(subject.filter { |e| e.event_type.starts_with?('work_package') }.map(&:journable_id))
.not_to include(subproject_work_package.id)
end
end

Loading…
Cancel
Save