fix flickering spec

pull/11550/head
ulferts 2 years ago
parent 1c01a7e037
commit d7932a93c2
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 10
      spec/models/query/results_spec.rb

@ -446,8 +446,8 @@ describe ::Query::Results, type: :model, with_mail: false do
context 'when filtering by precedes and ordering by id' do
let(:query) do
build :query,
project: project1
build(:query,
project: project1)
end
before do
@ -458,6 +458,12 @@ describe ::Query::Results, type: :model, with_mail: false do
query.add_filter('precedes', '=', [wp_p1[0].id.to_s])
query.sort_criteria = [['id', 'asc']]
# Reload is necessary as it fixes the lft/rgt columns of nested set
# that on some runs end up being the same as project2 (reason unknown),
# whereby the filter ends up with an invalid value since project2 gets loaded when
# executing project1.self_and_descendants where the wp_p1[0] is not in.
project1.reload
end
it 'returns the work packages preceding the filtered for work package' do

Loading…
Cancel
Save