Commit ffca0da0 authored by Robert Speicher's avatar Robert Speicher

Revert "Merge branch 'fix-latest-pipeine-ordering-again' into 'master'"

This reverts commit a18ad6cf.
parent e8254c30
...@@ -102,7 +102,7 @@ module Ci ...@@ -102,7 +102,7 @@ module Ci
end end
def self.latest_successful_for(ref) def self.latest_successful_for(ref)
success.latest(ref).order(id: :desc).first success.latest(ref).first
end end
def self.truncate_sha(sha) def self.truncate_sha(sha)
......
...@@ -462,19 +462,6 @@ describe Ci::Pipeline, models: true do ...@@ -462,19 +462,6 @@ 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') }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment