diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 12:08:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-23 12:08:38 +0000 |
commit | 5ad0cf26551baff8f08af8562a8d45e6ec14d71a (patch) | |
tree | 57f1a6bad31bcd11efacd3fdfb9cc92f88fb6a86 /spec/lib | |
parent | f47c768fad17d4c876e96524f83f8306f071db66 (diff) | |
download | gitlab-ce-5ad0cf26551baff8f08af8562a8d45e6ec14d71a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/gpg_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/kubernetes/kube_client_spec.rb | 28 | ||||
-rw-r--r-- | spec/lib/sentry/client/issue_spec.rb | 4 |
3 files changed, 23 insertions, 13 deletions
diff --git a/spec/lib/gitlab/gpg_spec.rb b/spec/lib/gitlab/gpg_spec.rb index 27a3010eeed..fac2dbfab71 100644 --- a/spec/lib/gitlab/gpg_spec.rb +++ b/spec/lib/gitlab/gpg_spec.rb @@ -208,8 +208,8 @@ describe Gitlab::Gpg do allow(FileUtils).to receive(:remove_entry).with(any_args).and_call_original end - it "tries for #{seconds}" do - expect(Retriable).to receive(:retriable).with(a_hash_including(max_elapsed_time: seconds)) + it "tries for #{seconds} or 15 times" do + expect(Retriable).to receive(:retriable).with(a_hash_including(max_elapsed_time: seconds, tries: 15)) described_class.using_tmp_keychain {} end diff --git a/spec/lib/gitlab/kubernetes/kube_client_spec.rb b/spec/lib/gitlab/kubernetes/kube_client_spec.rb index e08981a3415..729c2b04930 100644 --- a/spec/lib/gitlab/kubernetes/kube_client_spec.rb +++ b/spec/lib/gitlab/kubernetes/kube_client_spec.rb @@ -229,20 +229,30 @@ describe Gitlab::Kubernetes::KubeClient do end end - describe 'extensions API group' do - let(:api_groups) { ['apis/extensions'] } + describe '#get_deployments' do let(:extensions_client) { client.extensions_client } + let(:apps_client) { client.apps_client } - describe '#get_deployments' do - include_examples 'redirection not allowed', 'get_deployments' - include_examples 'dns rebinding not allowed', 'get_deployments' + include_examples 'redirection not allowed', 'get_deployments' + include_examples 'dns rebinding not allowed', 'get_deployments' - it 'delegates to the extensions client' do - expect(client).to delegate_method(:get_deployments).to(:extensions_client) + it 'delegates to the extensions client' do + expect(extensions_client).to receive(:get_deployments) + + client.get_deployments + end + + context 'extensions does not have deployments for Kubernetes 1.16+ clusters' do + before do + WebMock + .stub_request(:get, api_url + '/apis/extensions/v1beta1') + .to_return(kube_response(kube_1_16_extensions_v1beta1_discovery_body)) end - it 'responds to the method' do - expect(client).to respond_to :get_deployments + it 'delegates to the apps client' do + expect(apps_client).to receive(:get_deployments) + + client.get_deployments end end end diff --git a/spec/lib/sentry/client/issue_spec.rb b/spec/lib/sentry/client/issue_spec.rb index 061ebcfdc06..2762c5b5cb9 100644 --- a/spec/lib/sentry/client/issue_spec.rb +++ b/spec/lib/sentry/client/issue_spec.rb @@ -8,7 +8,7 @@ describe Sentry::Client::Issue do let(:token) { 'test-token' } let(:sentry_url) { 'https://sentrytest.gitlab.com/api/0' } let(:client) { Sentry::Client.new(sentry_url, token) } - let(:issue_id) { 503504 } + let(:issue_id) { 11 } describe '#list_issues' do shared_examples 'issues have correct return type' do |klass| @@ -243,7 +243,7 @@ describe Sentry::Client::Issue do end it 'has a correct external URL' do - expect(subject.external_url).to eq('https://sentrytest.gitlab.com/api/0/issues/503504') + expect(subject.external_url).to eq('https://sentrytest.gitlab.com/api/0/issues/11') end it 'issue has a correct external base url' do |