diff options
author | Jason Goodman <jgoodman@gitlab.com> | 2019-04-09 06:52:15 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-04-09 06:52:15 +0000 |
commit | 5b7003282b6b3ce1bfc313b3271bd6827a230c34 (patch) | |
tree | 63ef06c4bb6b87acbcc56d39bdd944a58f06931a /spec/models | |
parent | 74ac04a6aa7a9398ed908f47080e64ec40e0dee8 (diff) | |
download | gitlab-ce-5b7003282b6b3ce1bfc313b3271bd6827a230c34.tar.gz |
Set release name when adding release notes to an existing tag
Also set the release sha and author
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/release_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/release_spec.rb b/spec/models/release_spec.rb index b4b32c95dee..0b19a4f8efc 100644 --- a/spec/models/release_spec.rb +++ b/spec/models/release_spec.rb @@ -18,6 +18,22 @@ RSpec.describe Release do describe 'validation' do it { is_expected.to validate_presence_of(:project) } it { is_expected.to validate_presence_of(:description) } + it { is_expected.to validate_presence_of(:name) } + + context 'when a release exists in the database without a name' do + it 'does not require name' do + existing_release_without_name = build(:release, project: project, author: user, name: nil) + existing_release_without_name.save(validate: false) + + existing_release_without_name.description = "change" + existing_release_without_name.save + existing_release_without_name.reload + + expect(existing_release_without_name).to be_valid + expect(existing_release_without_name.description).to eq("change") + expect(existing_release_without_name.name).to be_nil + end + end end describe '#assets_count' do |