Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <alexis.reigel.ext@siemens.com>2018-10-31 22:12:22 +0300
committerAlexis Reigel <alexis.reigel.ext@siemens.com>2018-11-29 17:04:59 +0300
commit943827b39ae1e3203736ec87724ec255505ae980 (patch)
treef889e435ea91cb51bec5ec276f3a3d23d5faa524 /spec/support/features
parent5bf893952b82b4877790f5a7932b2f799393c686 (diff)
option to make variables protected by default
Diffstat (limited to 'spec/support/features')
-rw-r--r--spec/support/features/variable_list_shared_examples.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/support/features/variable_list_shared_examples.rb b/spec/support/features/variable_list_shared_examples.rb
index bce1fb01355..95f26a01f79 100644
--- a/spec/support/features/variable_list_shared_examples.rb
+++ b/spec/support/features/variable_list_shared_examples.rb
@@ -63,6 +63,44 @@ shared_examples 'variable list' do
end
end
+ context 'defaults to the application setting' do
+ context 'application setting is true' do
+ before do
+ stub_application_setting(protected_ci_variables: true)
+ end
+
+ it 'defaults to protected' do
+ visit page_path
+
+ page.within('.js-ci-variable-list-section .js-row:last-child') do
+ find('.js-ci-variable-input-key').set('key')
+ end
+
+ values = all('.js-ci-variable-input-protected', visible: false).map(&:value)
+
+ expect(values).to eq %w(false true true)
+ end
+ end
+
+ context 'application setting is false' do
+ before do
+ stub_application_setting(protected_ci_variables: false)
+ end
+
+ it 'defaults to unprotected' do
+ visit page_path
+
+ page.within('.js-ci-variable-list-section .js-row:last-child') do
+ find('.js-ci-variable-input-key').set('key')
+ end
+
+ values = all('.js-ci-variable-input-protected', visible: false).map(&:value)
+
+ expect(values).to eq %w(false false false)
+ end
+ end
+ end
+
it 'reveals and hides variables' do
page.within('.js-ci-variable-list-section') do
expect(first('.js-ci-variable-input-key').value).to eq(variable.key)