Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-01-07 14:54:35 +0300
committerRémy Coutable <remy@rymai.me>2019-01-07 14:54:35 +0300
commit4af1c77b291f7c7757143087f69720d26958153d (patch)
tree676dbc79c55f05f996c21e6046a92980b81e30a3 /spec/lib
parente1dc0b09d55fc90fe3603ec95220c75d6aeb5e9e (diff)
parenta06b7a7d5d6012b3f89ddaab5189a85f5cc49c14 (diff)
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/lib')
-rw-r--r--spec/lib/bitbucket_server/paginator_spec.rb11
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)