diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-17 18:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-17 18:09:13 +0300 |
commit | 283fb71e02992b6687e3264d53bbc718b7567109 (patch) | |
tree | 0d81d9417cb9b6a0b5c519061e99567fe26ad5cd /spec/models/release_spec.rb | |
parent | 518f1c923d6a11cc3dbc7b7c976ff8348bc1e08c (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 | 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 } |