Commit 7141f96a authored by Rémy Coutable's avatar Rémy Coutable

Fix iterations_finder_spec.rb which failed on PG11 only

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 5b5ba914
...@@ -67,9 +67,7 @@ RSpec.describe IterationsFinder do ...@@ -67,9 +67,7 @@ RSpec.describe IterationsFinder do
end end
it 'orders iterations by due date' do it 'orders iterations by due date' do
iteration = create(:iteration, :skip_future_date_validation, group: group, start_date: 5.days.ago, due_date: 3.days.ago) expect(subject.to_a).to eq([closed_iteration, root_closed_iteration, started_group_iteration, root_group_iteration, upcoming_group_iteration])
expect(subject.to_a).to eq([iteration, closed_iteration, root_closed_iteration, started_group_iteration, root_group_iteration, upcoming_group_iteration])
end end
end end
...@@ -136,17 +134,15 @@ RSpec.describe IterationsFinder do ...@@ -136,17 +134,15 @@ RSpec.describe IterationsFinder do
end end
it 'returns iterations which start before the timeframe' do it 'returns iterations which start before the timeframe' do
iteration = create(:iteration, :skip_project_validation, :skip_future_date_validation, group: group, start_date: 5.days.ago, due_date: 3.days.ago)
params.merge!(start_date: 3.days.ago, end_date: 2.days.ago) params.merge!(start_date: 3.days.ago, end_date: 2.days.ago)
expect(subject).to match_array([iteration, closed_iteration, root_closed_iteration]) expect(subject).to match_array([closed_iteration, root_closed_iteration])
end end
it 'returns iterations which end after the timeframe' do it 'returns iterations which end after the timeframe' do
iteration = create(:iteration, :skip_project_validation, group: group, start_date: 9.days.from_now, due_date: 2.weeks.from_now) params.merge!(start_date: 3.days.from_now, end_date: 5.days.from_now)
params.merge!(start_date: 9.days.from_now, end_date: 10.days.from_now)
expect(subject).to match_array([iteration]) expect(subject).to match_array([upcoming_group_iteration])
end end
describe 'when one of the timeframe params are missing' do describe 'when one of the timeframe params are missing' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment