summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McCallum <andrew.mccallum@semafone.com>2018-01-15 10:54:41 +0000
committerAndrew McCallum <andrew.mccallum@semafone.com>2018-01-15 10:54:41 +0000
commit328e1680a4f566a52b36f1197a954dc23ab9b30d (patch)
tree66810d1a0d2128247c0e61ccadd066406703f545
parente5afb44a9a1ef1f613f11e6bbb4134f30aaae655 (diff)
downloadgitlab-ce-328e1680a4f566a52b36f1197a954dc23ab9b30d.tar.gz
Add scenario of searching within context of repository with root slash to tests.
-rw-r--r--spec/models/repository_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index f3456e5b354..3d96f815c53 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -668,6 +668,11 @@ describe Repository do
expect(results.first).to eq('files/html/500.html')
end
+ it 'ignores root slash' do
+ result = repository.search_files_by_name('/files', 'master')
+ expect(results.first).to eq('files/html/500.html')
+ end
+
it 'properly handles when query is not present' do
results = repository.search_files_by_name('', 'master')