diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-05-17 09:47:48 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-05-21 08:52:35 +0300 |
commit | f1b43c1e4724a3e945a089fe60bb2f9a50052241 (patch) | |
tree | b87717d7ba56dee1d641d1daf5b1fae9bb8dceab /spec/models/clusters | |
parent | c1e89492375b696b25ff63257c3cbe58ce86cc18 (diff) |
Add spec for unathrozied proxy_url
Diffstat (limited to 'spec/models/clusters')
-rw-r--r-- | spec/models/clusters/applications/prometheus_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/clusters/applications/prometheus_spec.rb b/spec/models/clusters/applications/prometheus_spec.rb index aeca6ee903a..52404b0e247 100644 --- a/spec/models/clusters/applications/prometheus_spec.rb +++ b/spec/models/clusters/applications/prometheus_spec.rb @@ -85,6 +85,16 @@ describe Clusters::Applications::Prometheus do it 'copies options and headers from kube client to proxy client' do expect(subject.prometheus_client.options).to eq(kube_client.rest_client.options.merge(headers: kube_client.headers)) end + + context 'when cluster is not reachable' do + before do + allow(kube_client).to receive(:proxy_url).with(anything, anything, anything, anything).and_raise(Kubeclient::HttpError.new(401, 'Unauthorized', nil)) + end + + it 'returns nil' do + expect(subject.prometheus_client).to be_nil + end + end end end |