diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/models/release_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/models/release_spec.rb')
-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 716e7dc786e..fea15ea00c8 100644 --- a/spec/models/release_spec.rb +++ b/spec/models/release_spec.rb @@ -73,6 +73,22 @@ RSpec.describe Release do end end + describe '.create' do + it "fills released_at using created_at if it's not set" do + release = described_class.create(project: project, author: user) + + expect(release.released_at).to eq(release.created_at) + end + + it "does not change released_at if it's set explicitly" do + released_at = Time.zone.parse('2018-10-20T18:00:00Z') + + release = described_class.create(project: project, author: user, released_at: released_at) + + expect(release.released_at).to eq(released_at) + end + end + describe '#sources' do subject { release.sources } |