diff options
Diffstat (limited to 'spec/features/projects/tree/tree_show_spec.rb')
-rw-r--r-- | spec/features/projects/tree/tree_show_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/features/projects/tree/tree_show_spec.rb b/spec/features/projects/tree/tree_show_spec.rb index 388fa39874d..bd2af66710a 100644 --- a/spec/features/projects/tree/tree_show_spec.rb +++ b/spec/features/projects/tree/tree_show_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe 'Projects tree', :js do + include RepoHelpers + let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:gravatar_enabled) { true } @@ -47,6 +49,30 @@ RSpec.describe 'Projects tree', :js do expect(page).not_to have_selector('.flash-alert') end + context "with a tree that contains pathspec characters" do + let(:path) { ':wq' } + let(:filename) { File.join(path, 'test.txt') } + 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, 'master', 'master', filename, 'Test file', commit_message: message) + visit project_tree_path(project, File.join('master', path)) + wait_for_requests + end + + it "renders tree table without errors" do + expect(page).to have_selector('.tree-item') + expect(page).to have_content('test.txt') + expect(page).to have_content(message) + + # Check last commit + expect(find('.commit-content').text).to include(message) + expect(find('.commit-sha-group').text).to eq(short_newrev) + end + end + context 'gravatar disabled' do let(:gravatar_enabled) { false } |