Commit a5d2403e authored by Adam Hegyi's avatar Adam Hegyi

Fix flaky pagination test

Fix flaky pagination test
parent 50fd1ac6
...@@ -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