diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-05 15:06:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-05 15:06:20 +0300 |
commit | 791785af5540d18eaa97da24f9ff8638e1960b72 (patch) | |
tree | caeb6f08d9cc10a0052dc6851b46653d94c29022 /spec/finders/tags_finder_spec.rb | |
parent | a92d6b36c2d2892e8c070efb169f0c06815900ee (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders/tags_finder_spec.rb')
-rw-r--r-- | spec/finders/tags_finder_spec.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/finders/tags_finder_spec.rb b/spec/finders/tags_finder_spec.rb index 85f970b71c4..e9f29ab2441 100644 --- a/spec/finders/tags_finder_spec.rb +++ b/spec/finders/tags_finder_spec.rb @@ -54,6 +54,44 @@ describe TagsFinder do expect(result.count).to eq(0) end + + it 'filters tags by name that begins with' do + params = { search: '^v1.0' } + tags_finder = described_class.new(repository, params) + + result = tags_finder.execute + + expect(result.first.name).to eq('v1.0.0') + expect(result.count).to eq(1) + end + + it 'filters tags by name that ends with' do + params = { search: '0.0$' } + tags_finder = described_class.new(repository, params) + + result = tags_finder.execute + + expect(result.first.name).to eq('v1.0.0') + expect(result.count).to eq(1) + end + + it 'filters tags by nonexistent name that begins with' do + params = { search: '^nope' } + tags_finder = described_class.new(repository, params) + + result = tags_finder.execute + + expect(result.count).to eq(0) + end + + it 'filters tags by nonexistent name that ends with' do + params = { search: 'nope$' } + tags_finder = described_class.new(repository, params) + + result = tags_finder.execute + + expect(result.count).to eq(0) + end end context 'filter and sort' do |