diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 17:25:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 17:25:05 +0300 |
commit | df400447bfd5c650b32cc8d75fa80f8cc7099d94 (patch) | |
tree | a8cff21170078eb41d3fd08991c745dd7c86b176 /spec/views/admin | |
parent | ed15b5061242cb70b2e11c3d08c727e07aa932a8 (diff) |
Add latest changes from gitlab-org/security/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/views/admin')
-rw-r--r-- | spec/views/admin/application_settings/_eks.html.haml_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/views/admin/application_settings/_eks.html.haml_spec.rb b/spec/views/admin/application_settings/_eks.html.haml_spec.rb new file mode 100644 index 00000000000..52434557d3a --- /dev/null +++ b/spec/views/admin/application_settings/_eks.html.haml_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'admin/application_settings/_eks' do + let_it_be(:admin) { create(:admin) } + let(:page) { Capybara::Node::Simple.new(rendered) } + + before do + assign(:application_setting, application_setting) + allow(view).to receive(:current_user) { admin } + allow(view).to receive(:expanded) { true } + end + + shared_examples 'EKS secret access key input' do + it 'renders an empty password field' do + render + expect(rendered).to have_field('Secret access key', type: 'password') + expect(page.find_field('Secret access key').value).to be_blank + end + end + + context 'when eks_secret_access_key is not set' do + let(:application_setting) { build(:application_setting) } + + include_examples 'EKS secret access key input' + end + + context 'when eks_secret_access_key is set' do + let(:application_setting) { build(:application_setting, eks_secret_access_key: 'eks_secret_access_key') } + + include_examples 'EKS secret access key input' + end +end |