Fix disable storing of sensitive information when importing a new repo

This commit is contained in:
Clement Ho 2017-01-30 11:43:13 -06:00
parent 6aec85ac44
commit 38a97197b7
3 changed files with 23 additions and 5 deletions

View File

@ -2,7 +2,7 @@
= f.label :import_url, class: 'control-label' do
%span Git repository URL
.col-sm-10
= f.text_field :import_url, class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git', disabled: true
= f.text_field :import_url, autocomplete: 'off', class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git', disabled: true
.well.prepend-top-20
%ul

View File

@ -0,0 +1,4 @@
---
title: Fix disable storing of sensitive information when importing a new repo
merge_request: 8885
author: Bernard Pietraga

View File

@ -1,11 +1,13 @@
require "spec_helper"
feature "New project", feature: true do
let(:user) { create(:admin) }
before do
login_as(user)
end
context "Visibility level selector" do
let(:user) { create(:admin) }
before { login_as(user) }
Gitlab::VisibilityLevel.options.each do |key, level|
it "sets selector to #{key}" do
stub_application_setting(default_project_visibility: level)
@ -16,4 +18,16 @@ feature "New project", feature: true do
end
end
end
context 'Import project options' do
before do
visit new_project_path
end
it 'does not autocomplete sensitive git repo URL' do
autocomplete = find('#project_import_url')['autocomplete']
expect(autocomplete).to eq('off')
end
end
end