diff options
author | Robert Speicher <robert@gitlab.com> | 2016-08-19 21:01:12 +0300 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2016-08-19 23:31:02 +0300 |
commit | ebc9d34d242e9c7821bef64acb07a5101525604d (patch) | |
tree | a24a871e9b905942af1bbf5d1e353870d14430f3 /spec | |
parent | 594f938927d273f637a68c4bb5e3271f689d17b6 (diff) |
Merge branch 'directory-names-containing-space' into 'master'
Do not escape URI when extracting path
## What does this MR do?
- remove escaping of URI parameters after they have already been unescaped in `ExtractsPath`
- remove spec that is relying on that behavior
## Why was this MR needed?
- spaces in directory names were escaped leading to 404 errors on repository files page
## What are the relevant issue numbers?
fixes gitlab-com/support-forum#952, #21106
See merge request !5878
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/extracts_path_spec.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/spec/lib/extracts_path_spec.rb b/spec/lib/extracts_path_spec.rb index 36c77206a3f..86d04ecfa36 100644 --- a/spec/lib/extracts_path_spec.rb +++ b/spec/lib/extracts_path_spec.rb @@ -30,17 +30,6 @@ describe ExtractsPath, lib: true do expect(@logs_path).to eq("/#{@project.path_with_namespace}/refs/#{ref}/logs_tree/files/ruby/popen.rb") end - context 'escaped slash character in ref' do - let(:ref) { 'improve%2Fawesome' } - - it 'has no escape sequences in @ref or @logs_path' do - assign_ref_vars - - expect(@ref).to eq('improve/awesome') - expect(@logs_path).to eq("/#{@project.path_with_namespace}/refs/#{ref}/logs_tree/files/ruby/popen.rb") - end - end - context 'ref contains %20' do let(:ref) { 'foo%20bar' } @@ -52,6 +41,16 @@ describe ExtractsPath, lib: true do expect(@id).to start_with('foo%20bar/') end end + + context 'path contains space' do + let(:params) { { path: 'with space', ref: '38008cb17ce1466d8fec2dfa6f6ab8dcfe5cf49e' } } + + it 'is not converted to %20 in @path' do + assign_ref_vars + + expect(@path).to eq(params[:path]) + end + end end describe '#extract_ref' do |