Commit 101cde38 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Use Ci::Pipeline#latest for finding pipelines

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_18861407
parent 6b2eb15359b0
......@@ -20,7 +20,8 @@ def entity
def status
@project.pipelines
.where(sha: @sha, ref: @ref)
.where(sha: @sha)
.latest(@ref)
.status || 'unknown'
end
......
......@@ -69,8 +69,8 @@
new_build.success!
end
it 'reports the compound status' do
expect(badge.status).to eq 'failed'
it 'does not take outdated pipeline into account' do
expect(badge.status).to eq 'success'
end
end
end
......
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