Skip to content
Snippets Groups Projects
Commit e60bf0d6 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Add a test for latest_successful_for

parent 655289dd
No related branches found
No related tags found
No related merge requests found
---
title: Fix finding the latest pipeline
merge_request: 8301
author:
Loading
@@ -464,6 +464,19 @@ describe Ci::Pipeline, models: true do
Loading
@@ -464,6 +464,19 @@ describe Ci::Pipeline, models: true do
end end
end end
   
describe '.latest_successful_for' do
include_context 'with some outdated pipelines'
let!(:latest_successful_pipeline) do
create_pipeline(:success, 'ref', 'D')
end
it 'returns the latest successful pipeline' do
expect(described_class.latest_successful_for('ref')).
to eq(latest_successful_pipeline)
end
end
describe '#status' do describe '#status' do
let!(:build) { create(:ci_build, :created, pipeline: pipeline, name: 'test') } let!(:build) { create(:ci_build, :created, pipeline: pipeline, name: 'test') }
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment