diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-10 21:09:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-10 21:09:14 +0300 |
commit | d18b7dc5eea84db5008986c6879a24ad7f6462a6 (patch) | |
tree | 98d6e8635ac32f210f15fcfb3dc583a6295e0b9a /spec/views/projects | |
parent | 6ebe886c82111e1ab9e71d4c02a888d2312898bc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/projects')
-rw-r--r-- | spec/views/projects/empty.html.haml_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/views/projects/empty.html.haml_spec.rb b/spec/views/projects/empty.html.haml_spec.rb index 416dfc10174..6077dda3c98 100644 --- a/spec/views/projects/empty.html.haml_spec.rb +++ b/spec/views/projects/empty.html.haml_spec.rb @@ -25,6 +25,21 @@ RSpec.describe 'projects/empty' do expect(rendered).to have_content("git clone") end + + context 'when default branch name contains special shell characters' do + let(:branch_name) { ';rm -rf /' } + + before do + allow(project).to receive(:default_branch_or_main).and_return(branch_name) + end + + it 'escapes the default branch name' do + render + + expect(rendered).not_to have_content(branch_name) + expect(rendered).to have_content(branch_name.shellescape) + end + end end context 'when user can not push code on the project' do |