diff options
Diffstat (limited to 'spec/features/projects/commits')
-rw-r--r-- | spec/features/projects/commits/user_browses_commits_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/features/projects/commits/user_browses_commits_spec.rb b/spec/features/projects/commits/user_browses_commits_spec.rb index 2796156bfbf..dee964005a4 100644 --- a/spec/features/projects/commits/user_browses_commits_spec.rb +++ b/spec/features/projects/commits/user_browses_commits_spec.rb @@ -137,6 +137,33 @@ RSpec.describe 'User browses commits' do .and have_selector('entry summary', text: commit.description[0..10].delete("\r\n")) end + context "when commit has a filename with pathspec characters" do + let(:path) { ':wq' } + let(:filename) { File.join(path, 'test.txt') } + let(:ref) { project.repository.root_ref } + let(:newrev) { project.repository.commit('master').sha } + let(:short_newrev) { project.repository.commit('master').short_id } + let(:message) { 'Glob characters'} + + before do + create_file_in_repo(project, ref, ref, filename, 'Test file', commit_message: message) + visit project_commits_path(project, "#{ref}/#{path}", limit: 1) + wait_for_requests + end + + it 'searches commit', :js do + expect(page).to have_content(message) + + fill_in 'commits-search', with: 'bogus12345' + + expect(page).to have_content "Your search didn't match any commits" + + fill_in 'commits-search', with: 'Glob' + + expect(page).to have_content message + end + end + context 'when a commit links to a confidential issue' do let(:confidential_issue) { create(:issue, confidential: true, title: 'Secret issue!', project: project) } |