diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 18:06:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 18:06:39 +0300 |
commit | 68b6846fa6c7b630cc8dab7a8474dcc34e4d67d4 (patch) | |
tree | f592f2a5fed915184154ffd05e4e44298a192207 /spec/finders | |
parent | 4db9eeb44af5644eb1d080b4ccf4aff8b90656b9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/tags_finder_spec.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/spec/finders/tags_finder_spec.rb b/spec/finders/tags_finder_spec.rb index e9f29ab2441..582d82bbf79 100644 --- a/spec/finders/tags_finder_spec.rb +++ b/spec/finders/tags_finder_spec.rb @@ -95,24 +95,25 @@ describe TagsFinder do end context 'filter and sort' do - it 'filters tags by name and sorts by recently_updated' do - params = { sort: 'updated_desc', search: 'v1' } - tags_finder = described_class.new(repository, params) + let(:tags_to_compare) { %w[v1.0.0 v1.1.0] } + subject { described_class.new(repository, params).execute.select { |tag| tags_to_compare.include?(tag.name) } } - result = tags_finder.execute + context 'when sort by updated_desc' do + let(:params) { { sort: 'updated_desc', search: 'v1' } } - expect(result.first.name).to eq('v1.1.0') - expect(result.count).to eq(2) + it 'filters tags by name' do + expect(subject.first.name).to eq('v1.1.0') + expect(subject.count).to eq(2) + end end - it 'filters tags by name and sorts by last_updated' do - params = { sort: 'updated_asc', search: 'v1' } - tags_finder = described_class.new(repository, params) - - result = tags_finder.execute + context 'when sort by updated_asc' do + let(:params) { { sort: 'updated_asc', search: 'v1' } } - expect(result.first.name).to eq('v1.0.0') - expect(result.count).to eq(2) + it 'filters tags by name' do + expect(subject.first.name).to eq('v1.0.0') + expect(subject.count).to eq(2) + end end end end |