diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/lib/bitbucket | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/lib/bitbucket')
-rw-r--r-- | spec/lib/bitbucket/connection_spec.rb | 10 |
1 files changed, 6 insertions, 4 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 |