diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-05-17 15:47:48 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-05-21 14:52:35 +0900 |
commit | f1b43c1e4724a3e945a089fe60bb2f9a50052241 (patch) | |
tree | b87717d7ba56dee1d641d1daf5b1fae9bb8dceab /spec/features/projects/environments/environments_spec.rb | |
parent | c1e89492375b696b25ff63257c3cbe58ce86cc18 (diff) | |
download | gitlab-ce-f1b43c1e4724a3e945a089fe60bb2f9a50052241.tar.gz |
Add spec for unathrozied proxy_url
Diffstat (limited to 'spec/features/projects/environments/environments_spec.rb')
-rw-r--r-- | spec/features/projects/environments/environments_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index 5248a783db4..c9be5f6ce54 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -42,6 +42,22 @@ feature 'Environments page', :js do expect(page).to have_content('You don\'t have any environments right now') end end + + context 'when cluster is not reachable' do + let!(:cluster) { create(:cluster, :provided_by_gcp, projects: [project]) } + let!(:application_prometheus) { create(:clusters_applications_prometheus, :installed, cluster: cluster) } + + before do + allow_any_instance_of(Kubeclient::Client).to receive(:proxy_url).with(anything, anything, anything, anything).and_raise(Kubeclient::HttpError.new(401, 'Unauthorized', nil)) + end + + it 'should show one environment without error' do + visit_environments(project, scope: 'available') + + expect(page).to have_css('.environments-container') + expect(page.all('.environment-name').length).to eq(1) + end + end end describe 'with one stopped environment' do |