diff options
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/files/user_browses_files_spec.rb | 20 | ||||
-rw-r--r-- | spec/features/projects/tree/tree_show_spec.rb | 22 |
2 files changed, 42 insertions, 0 deletions
diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb index 44b5833a8c8..968cfbd17b9 100644 --- a/spec/features/projects/files/user_browses_files_spec.rb +++ b/spec/features/projects/files/user_browses_files_spec.rb @@ -3,6 +3,8 @@ require "spec_helper" RSpec.describe "User browses files" do + include RepoHelpers + let(:fork_message) do "You're not allowed to make changes to this project directly. "\ "A fork of this project has been created that you can make changes in, so you can submit a merge request." @@ -339,6 +341,24 @@ RSpec.describe "User browses files" do end end + context "when browsing a file with glob characters" do + let(:filename) { ':wq' } + let(:newrev) { project.repository.commit('master').sha } + + before do + create_file_in_repo(project, 'master', 'master', filename, 'Test file') + path = File.join('master', filename) + + visit(project_blob_path(project, path)) + end + + it "shows a raw file content" do + click_link("Open raw") + + expect(source).to eq("") # Body is filled in by gitlab-workhorse + end + end + context "when browsing a raw file" do before do path = File.join(RepoHelpers.sample_commit.id, RepoHelpers.sample_blob.path) diff --git a/spec/features/projects/tree/tree_show_spec.rb b/spec/features/projects/tree/tree_show_spec.rb index 388fa39874d..7e2a41ad6e6 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,26 @@ RSpec.describe 'Projects tree', :js do expect(page).not_to have_selector('.flash-alert') end + context "with a tree that contains glob characters" do + let(:path) { ':wq' } + let(:filename) { File.join(path, 'test.txt') } + let(:newrev) { project.repository.commit('master').sha } + 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 + + # Disabled until https://gitlab.com/gitlab-org/gitaly/-/issues/2888 is resolved + xit "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) + end + end + context 'gravatar disabled' do let(:gravatar_enabled) { false } |