diff options
author | Rémy Coutable <remy@rymai.me> | 2019-01-07 11:54:35 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-01-07 11:54:35 +0000 |
commit | 4af1c77b291f7c7757143087f69720d26958153d (patch) | |
tree | 676dbc79c55f05f996c21e6046a92980b81e30a3 /spec | |
parent | e1dc0b09d55fc90fe3603ec95220c75d6aeb5e9e (diff) | |
parent | a06b7a7d5d6012b3f89ddaab5189a85f5cc49c14 (diff) | |
download | gitlab-ce-4af1c77b291f7c7757143087f69720d26958153d.tar.gz |
Merge branch 'sh-fix-issue-55914' into 'master'
Fix Bitbucket Server import only including first 25 pull requests
Closes #55914
See merge request gitlab-org/gitlab-ce!24178
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/bitbucket_server/paginator_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/bitbucket_server/paginator_spec.rb b/spec/lib/bitbucket_server/paginator_spec.rb index d268d4f23cf..eadd7f68bfb 100644 --- a/spec/lib/bitbucket_server/paginator_spec.rb +++ b/spec/lib/bitbucket_server/paginator_spec.rb @@ -30,6 +30,17 @@ describe BitbucketServer::Paginator do expect { limited.items }.to raise_error(StopIteration) end + it 'does not stop if limit is unspecified' do + stub_const("BitbucketServer::Paginator::PAGE_LENGTH", 1) + paginator = described_class.new(connection, 'http://more-data', :pull_request, page_offset: 0, limit: nil) + allow(paginator).to receive(:fetch_next_page).and_return(first_page, last_page) + + expect(paginator.has_next_page?).to be_truthy + expect(paginator.items).to match(['item_1']) + expect(paginator.has_next_page?).to be_truthy + expect(paginator.items).to match(['item_2']) + end + it 'calls the connection with different offsets' do expect(connection).to receive(:get).with('http://more-data', start: 0, limit: BitbucketServer::Paginator::PAGE_LENGTH).and_return(page_attrs) |