debian-mirror-gitlab/spec/views/admin/application_settings/_eks.html.haml_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1 KiB
Ruby
Raw Normal View History

2020-05-30 21:06:31 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe 'admin/application_settings/_eks' do
2020-05-30 21:06:31 +05:30
let_it_be(:admin) { create(:admin) }
2021-09-30 23:02:18 +05:30
2020-05-30 21:06:31 +05:30
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
2022-05-07 20:08:51 +05:30
expect(rendered).to have_field('AWS secret access key (Optional)', type: 'password')
expect(page.find_field('AWS secret access key (Optional)').value).to be_blank
2020-05-30 21:06:31 +05:30
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