diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-15 18:13:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-15 18:13:59 +0300 |
commit | f9da8786f9421281e390d921333f8ff4c9941354 (patch) | |
tree | 88e44000c2abe0589cf3aee22861eb7a73146127 /spec/models/release_spec.rb | |
parent | a19ad7fa983054d09b35c5fe0bdf853acc55a1bc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/release_spec.rb')
-rw-r--r-- | spec/models/release_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/release_spec.rb b/spec/models/release_spec.rb index 6a871ec039c..bff9f73e44a 100644 --- a/spec/models/release_spec.rb +++ b/spec/models/release_spec.rb @@ -39,6 +39,24 @@ RSpec.describe Release, feature_category: :release_orchestration do end end + describe 'scopes' do + let_it_be(:another_project) { create(:project) } + let_it_be(:release) { create(:release, project: project, author: user, tag: 'v1') } + let_it_be(:another_release) { create(:release, project: another_project, tag: 'v2') } + + describe '.for_projects' do + it 'returns releases for the given projects' do + expect(described_class.for_projects([project])).to eq([release]) + end + end + + describe '.by_tag' do + it 'returns releases with the given tag' do + expect(described_class.by_tag(release.tag)).to eq([release]) + end + end + end + context 'when description of a release is longer than the limit' do let(:description) { 'a' * (Gitlab::Database::MAX_TEXT_SIZE_LIMIT + 1) } let(:release) { build(:release, project: project, description: description) } |