Skip to content

Commit 0aa6b48

Browse files
committed
Fix flaky tests
1 parent 703eb66 commit 0aa6b48

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

spec/ajax-datatables-rails/orm/active_record_filter_records_spec.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,11 @@
358358
it 'should filter records matching with multiple' do
359359
datatable.params[:columns]['1'][:search][:value] = 'john@foo.com|henry@baz.com'
360360
expect(datatable.data.size).to eq 2
361-
item_first = datatable.data.first
362-
item_last = datatable.data.last
363-
expect(item_first[:email]).to eq 'john@foo.com'
364-
expect(item_last[:email]).to eq 'henry@baz.com'
361+
items = datatable.data.sort_by { |h| h[:email] }
362+
item_first = items.first
363+
item_last = items.last
364+
expect(item_first[:email]).to eq 'henry@baz.com'
365+
expect(item_last[:email]).to eq 'john@foo.com'
365366
end
366367

367368
it 'should filter records matching with multiple contains not found' do

0 commit comments

Comments
 (0)