Commit 8406dd97 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '225811-fix-default-pagination-parameters' into 'master'

Fix pagination parameters for Jira issue list

See merge request gitlab-org/gitlab!36427
parents 192b7553 a67d4f9e
......@@ -12,8 +12,8 @@ module Jira
super(jira_service, params)
@jql = params[:jql].to_s
@page = params[:page].to_i || 1
@per_page = params[:per_page].to_i || PER_PAGE
@page = (params[:page] || 1).to_i
@per_page = (params[:per_page] || PER_PAGE).to_i
end
private
......
......@@ -93,6 +93,16 @@ RSpec.describe Jira::Requests::Issues::ListService do
subject
end
end
context 'without pagination parameters' do
let(:params) { {} }
it 'uses the default options' do
expect(client).to receive(:get).with(include('startAt=0&maxResults=100'))
subject
end
end
end
end
end
......
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