Commit 3bfd031c authored by Jan Provaznik's avatar Jan Provaznik

Merge branch '327827-fix-flaky-pagination-test' into 'master'

Fix flaky pagination test

See merge request gitlab-org/gitlab!59454
parents 248070c8 a5d2403e
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Gitlab::Pagination::OffsetHeaderBuilder, type: :controller do RSpec.describe Gitlab::Pagination::OffsetHeaderBuilder, type: :controller do
controller(ActionController::Base) do controller(ActionController::Base) do
def index def index
relation = Project.where(archived: params[:archived]).page(params[:page]).per(1) relation = Project.where(archived: params[:archived]).page(params[:page]).order(:id).per(1)
params_for_pagination = { archived: params[:archived], page: params[:page] } params_for_pagination = { archived: params[:archived], page: params[:page] }
...@@ -22,7 +22,7 @@ RSpec.describe Gitlab::Pagination::OffsetHeaderBuilder, type: :controller do ...@@ -22,7 +22,7 @@ RSpec.describe Gitlab::Pagination::OffsetHeaderBuilder, type: :controller do
end end
end end
let_it_be(:projects) { create_list(:project, 2, archived: true) } let_it_be(:projects) { create_list(:project, 2, archived: true).sort_by(&:id) }
describe 'pagination' do describe 'pagination' do
it 'returns correct result for the first page' do it 'returns correct result for the first page' 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