From af7d383675269523ca4c6b7bddf8a34f6054f6af Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 12 Sep 2016 21:27:59 +0800 Subject: [PATCH] should show the status of the latest one --- app/models/commit.rb | 2 +- spec/requests/api/commits_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/commit.rb b/app/models/commit.rb index e64fd1e0c1b..0e2ab76d347 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -231,7 +231,7 @@ class Commit def status return @status if defined?(@status) - @status ||= pipelines.status + @status ||= pipelines.order(:id).last.try(:status) end def revert_branch_name diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb index 5b3dc60aba2..e24e92e063c 100644 --- a/spec/requests/api/commits_spec.rb +++ b/spec/requests/api/commits_spec.rb @@ -110,7 +110,7 @@ describe API::API, api: true do get api("/projects/#{project.id}/repository/commits/#{project.repository.commit.id}", user) expect(response).to have_http_status(200) - expect(json_response['status']).to be_nil + expect(json_response['status']).to eq('created') end end -- GitLab