diff options
Diffstat (limited to 'spec/features/projects/files/user_browses_files_spec.rb')
-rw-r--r-- | spec/features/projects/files/user_browses_files_spec.rb | 20 |
1 files changed, 20 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..e5259bd88be 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 pathspec 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) |