diff options
author | Andrew McCallum <andrew.mccallum@semafone.com> | 2018-01-15 18:19:43 +0300 |
---|---|---|
committer | Andrew McCallum <andrew.mccallum@semafone.com> | 2018-01-15 18:19:43 +0300 |
commit | a539e03d7e4f12cfaa3ae7998dd111f498f4c8dc (patch) | |
tree | 09749110027c9e57012d0dd52e137a2a96b6cb14 /spec/models/repository_spec.rb | |
parent | 7ce732fb3746df82790ea80a48560e62b486b225 (diff) |
Account for query of only forward slash(es).
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r-- | spec/models/repository_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 5860a0bf698..6767d818009 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -670,9 +670,16 @@ describe Repository do it 'ignores leading slashes' do results = repository.search_files_by_name('/files', 'master') + expect(results.first).to eq('files/html/500.html') end + it 'properly handles when query is only slashes' do + results = repository.search_files_by_name('//', 'master') + + expect(results).to match_array([]) + end + it 'properly handles when query is not present' do results = repository.search_files_by_name('', 'master') |