summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-22 06:13:08 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-22 06:13:08 +0000
commit8cfb9f566dae84d7ff76cdc3c4afa864fca94737 (patch)
tree42f665911cc906417d5753f3a4c40277f8893e8a /spec/lib
parentb03a2c6d75acce32ad51dfb9300f439c01fb0039 (diff)
downloadgitlab-ce-8cfb9f566dae84d7ff76cdc3c4afa864fca94737.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/bitbucket/connection_spec.rb10
-rw-r--r--spec/lib/gitlab/bitbucket_import/importer_spec.rb10
2 files changed, 7 insertions, 13 deletions
diff --git a/spec/lib/bitbucket/connection_spec.rb b/spec/lib/bitbucket/connection_spec.rb
index bed44b94f44..58a05c52b9f 100644
--- a/spec/lib/bitbucket/connection_spec.rb
+++ b/spec/lib/bitbucket/connection_spec.rb
@@ -3,6 +3,8 @@
require 'spec_helper'
RSpec.describe Bitbucket::Connection do
+ let(:token) { 'token' }
+
before do
allow_next_instance_of(described_class) do |instance|
allow(instance).to receive(:provider).and_return(double(app_id: '', app_secret: ''))
@@ -15,7 +17,7 @@ RSpec.describe Bitbucket::Connection do
expect(instance).to receive(:get).and_return(double(parsed: true))
end
- connection = described_class.new({})
+ connection = described_class.new({ token: token })
connection.get('/users')
end
@@ -27,19 +29,19 @@ RSpec.describe Bitbucket::Connection do
expect(instance).to receive(:expired?).and_return(true)
end
- expect(described_class.new({}).expired?).to be_truthy
+ expect(described_class.new({ token: token }).expired?).to be_truthy
end
end
describe '#refresh!' do
it 'calls connection.refresh!' do
- response = double(token: nil, expires_at: nil, expires_in: nil, refresh_token: nil)
+ response = double(token: token, expires_at: nil, expires_in: nil, refresh_token: nil)
expect_next_instance_of(OAuth2::AccessToken) do |instance|
expect(instance).to receive(:refresh!).and_return(response)
end
- described_class.new({}).refresh!
+ described_class.new({ token: token }).refresh!
end
end
end
diff --git a/spec/lib/gitlab/bitbucket_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_import/importer_spec.rb
index e0a7044e5f9..a9534101567 100644
--- a/spec/lib/gitlab/bitbucket_import/importer_spec.rb
+++ b/spec/lib/gitlab/bitbucket_import/importer_spec.rb
@@ -59,15 +59,7 @@ RSpec.describe Gitlab::BitbucketImport::Importer do
end
let(:project_identifier) { 'namespace/repo' }
-
- let(:data) do
- {
- 'bb_session' => {
- 'bitbucket_token' => "123456",
- 'bitbucket_refresh_token' => "secret"
- }
- }
- end
+ let(:data) { { 'token' => 'token' } }
let(:project) do
create(