Commit a67d4f9e authored by Arturo Herrero's avatar Arturo Herrero

Fix pagination parameters for Jira issue list

When no parameter was used the default was 0 after casting. This is
incorrect and the default parameters should be used.
parent 028e1fd1
......@@ -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