summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2018-04-04 15:56:41 +0200
committerDouwe Maan <douwe@selenight.nl>2018-04-04 17:18:52 +0200
commit097636575c7d1e85b16e4c4eb7d87ce74137d64f (patch)
tree725bf14c2d89a7fe945921fcd0714bf59923ad75 /spec/helpers
parenteaed588bf228c833cb666a61bc7d25cf21d5f94b (diff)
downloadgitlab-ce-097636575c7d1e85b16e4c4eb7d87ce74137d64f.tar.gz
Fix links to subdirectories of a directory with a plus character in its pathdm-flatten-tree-plus-chars
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/tree_helper_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers/tree_helper_spec.rb b/spec/helpers/tree_helper_spec.rb
index ccac6e29447..ffdf6561a53 100644
--- a/spec/helpers/tree_helper_spec.rb
+++ b/spec/helpers/tree_helper_spec.rb
@@ -8,6 +8,7 @@ describe TreeHelper do
describe '.render_tree' do
before do
@id = sha
+ @path = ""
@project = project
@lfs_blob_ids = []
end
@@ -61,6 +62,15 @@ describe TreeHelper do
end
end
end
+
+ context 'when the root path contains a plus character' do
+ let(:root_path) { 'gtk/C++' }
+ let(:tree_item) { double(flat_path: 'gtk/C++/glade') }
+
+ it 'returns the flattened path' do
+ expect(subject).to eq('glade')
+ end
+ end
end
describe '#commit_in_single_accessible_branch' do