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
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2016-12-13 18:59:21 +0300
committerValery Sizov <valery@gitlab.com>2016-12-13 18:59:21 +0300
commit0057ed1e69bc203d82fd3e8dfa6db7ea6a9b1de7 (patch)
treec72e7cbab5c1ce826963408afe9b3f6d8290ef89 /spec/lib/bitbucket
parenta2be395401f6320d2722bbd98de0c046d05f0480 (diff)
BB importer: Fixed after code review[ci skip]
Diffstat (limited to 'spec/lib/bitbucket')
-rw-r--r--spec/lib/bitbucket/collection_spec.rb1
-rw-r--r--spec/lib/bitbucket/connection_spec.rb5
2 files changed, 6 insertions, 0 deletions
diff --git a/spec/lib/bitbucket/collection_spec.rb b/spec/lib/bitbucket/collection_spec.rb
index eeed61b0488..015a7f80e03 100644
--- a/spec/lib/bitbucket/collection_spec.rb
+++ b/spec/lib/bitbucket/collection_spec.rb
@@ -18,6 +18,7 @@ end
describe Bitbucket::Collection do
it "iterates paginator" do
collection = described_class.new(TestPaginator.new)
+
expect(collection.to_a).to match(["result_1_page_1", "result_2_page_1", "result_1_page_2", "result_2_page_2"])
end
end
diff --git a/spec/lib/bitbucket/connection_spec.rb b/spec/lib/bitbucket/connection_spec.rb
index 5242c6fac34..6be681a8b47 100644
--- a/spec/lib/bitbucket/connection_spec.rb
+++ b/spec/lib/bitbucket/connection_spec.rb
@@ -4,7 +4,9 @@ describe Bitbucket::Connection do
describe '#get' do
it 'calls OAuth2::AccessToken::get' do
expect_any_instance_of(OAuth2::AccessToken).to receive(:get).and_return(double(parsed: true))
+
connection = described_class.new({})
+
connection.get('/users')
end
end
@@ -12,6 +14,7 @@ describe Bitbucket::Connection do
describe '#expired?' do
it 'calls connection.expired?' do
expect_any_instance_of(OAuth2::AccessToken).to receive(:expired?).and_return(true)
+
expect(described_class.new({}).expired?).to be_truthy
end
end
@@ -19,7 +22,9 @@ describe Bitbucket::Connection do
describe '#refresh!' do
it 'calls connection.refresh!' do
response = double(token: nil, expires_at: nil, expires_in: nil, refresh_token: nil)
+
expect_any_instance_of(OAuth2::AccessToken).to receive(:refresh!).and_return(response)
+
described_class.new({}).refresh!
end
end