summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/gitlab_import/client_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/gitlab_import/client_spec.rb')
-rw-r--r--spec/lib/gitlab/gitlab_import/client_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/lib/gitlab/gitlab_import/client_spec.rb b/spec/lib/gitlab/gitlab_import/client_spec.rb
index 0f1745fcc02..246ef6c02f2 100644
--- a/spec/lib/gitlab/gitlab_import/client_spec.rb
+++ b/spec/lib/gitlab/gitlab_import/client_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Gitlab::GitlabImport::Client do
@@ -19,18 +21,24 @@ describe Gitlab::GitlabImport::Client do
it 'uses membership and simple flags' do
stub_request('/api/v4/projects?membership=true&page=1&per_page=100&simple=true')
- expect_any_instance_of(OAuth2::Response).to receive(:parsed).and_return([])
+ expect_next_instance_of(OAuth2::Response) do |instance|
+ expect(instance).to receive(:parsed).and_return([])
+ end
expect(client.projects.to_a).to eq []
end
shared_examples 'pagination params' do
before do
- allow_any_instance_of(OAuth2::Response).to receive(:parsed).and_return([])
+ allow_next_instance_of(OAuth2::Response) do |instance|
+ allow(instance).to receive(:parsed).and_return([])
+ end
end
it 'allows page_limit param' do
- allow_any_instance_of(OAuth2::Response).to receive(:parsed).and_return(element_list)
+ allow_next_instance_of(OAuth2::Response) do |instance|
+ allow(instance).to receive(:parsed).and_return(element_list)
+ end
expect(client).to receive(:lazy_page_iterator).with(hash_including(page_limit: 2)).and_call_original