diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/finders/releases_finder_spec.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/finders/releases_finder_spec.rb')
-rw-r--r-- | spec/finders/releases_finder_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/finders/releases_finder_spec.rb b/spec/finders/releases_finder_spec.rb index bee0ae0d5c1..2603a205c42 100644 --- a/spec/finders/releases_finder_spec.rb +++ b/spec/finders/releases_finder_spec.rb @@ -26,6 +26,18 @@ RSpec.describe ReleasesFinder, feature_category: :release_orchestration do end end + shared_examples_for 'when a release is tagless' do + # There shouldn't be tags in this state, but because some exist in production and cause page loading errors, this + # test exists. We can test empty string but not the nil value since there is a not null constraint at the database + # level. + it 'does not return the tagless release' do + empty_string_tag = create(:release, project: project, tag: 'v99.0.0') + empty_string_tag.update_column(:tag, '') + + expect(subject).not_to include(empty_string_tag) + end + end + shared_examples_for 'preload' do it 'preloads associations' do expect(Release).to receive(:preloaded).once.and_call_original @@ -89,6 +101,7 @@ RSpec.describe ReleasesFinder, feature_category: :release_orchestration do it_behaves_like 'preload' it_behaves_like 'when a tag parameter is passed' + it_behaves_like 'when a release is tagless' end end @@ -132,6 +145,7 @@ RSpec.describe ReleasesFinder, feature_category: :release_orchestration do it_behaves_like 'preload' it_behaves_like 'when a tag parameter is passed' + it_behaves_like 'when a release is tagless' context 'with sorting parameters' do it 'sorted by released_at in descending order by default' do @@ -223,6 +237,7 @@ RSpec.describe ReleasesFinder, feature_category: :release_orchestration do end it_behaves_like 'preload' + it_behaves_like 'when a release is tagless' end end end |