diff options
Diffstat (limited to 'spec/models/release_spec.rb')
-rw-r--r-- | spec/models/release_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/release_spec.rb b/spec/models/release_spec.rb index bff9f73e44a..4a4cb1ae46a 100644 --- a/spec/models/release_spec.rb +++ b/spec/models/release_spec.rb @@ -156,6 +156,7 @@ RSpec.describe Release, feature_category: :release_orchestration do describe 'latest releases' do let_it_be(:yesterday) { Time.zone.now - 1.day } + let_it_be(:today) { Time.zone.now } let_it_be(:tomorrow) { Time.zone.now + 1.day } let_it_be(:project2) { create(:project) } @@ -176,6 +177,14 @@ RSpec.describe Release, feature_category: :release_orchestration do create(:release, project: project2, released_at: tomorrow, created_at: yesterday) end + let_it_be(:project2_release3) do + create(:release, project: project2, released_at: today, created_at: yesterday) + end + + let_it_be(:project2_release4) do + create(:release, project: project2, released_at: today, created_at: yesterday, release_published_at: today) + end + let(:args) { {} } describe '.latest' do @@ -240,6 +249,16 @@ RSpec.describe Release, feature_category: :release_orchestration do end end end + + describe '.waiting_for_publish_event' do + let(:releases) { [project2_release3] } + + subject(:waiting) { described_class.waiting_for_publish_event } + + it "find today's releases not yet published" do + expect(waiting).to match_array(releases) + end + end end describe '#assets_count' do |