Skip to content
Snippets Groups Projects
Commit daca1c65 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Fix broken tests

parent c61dc131
No related branches found
No related tags found
1 merge request!1530Implement Commit Status API
Pipeline #
Loading
@@ -82,7 +82,7 @@ module Ci
Loading
@@ -82,7 +82,7 @@ module Ci
end end
   
def stage def stage
running_or_pending = statuses.latest.running_or_pending running_or_pending = statuses.latest.running_or_pending.ordered
running_or_pending.first.try(:stage) running_or_pending.first.try(:stage)
end end
   
Loading
@@ -189,7 +189,7 @@ module Ci
Loading
@@ -189,7 +189,7 @@ module Ci
end end
   
def matrix_for_ref?(ref) def matrix_for_ref?(ref)
latest_builds_for_ref(ref).size > 1 builds_without_retry_for_ref(ref).size > 1
end end
   
def config_processor def config_processor
Loading
Loading
Loading
@@ -43,7 +43,7 @@ module API
Loading
@@ -43,7 +43,7 @@ module API
# Examples: # Examples:
# POST /projects/:id/statuses/:sha # POST /projects/:id/statuses/:sha
post ':id/statuses/:sha' do post ':id/statuses/:sha' do
authorize! :create_commit_statuses, user_project authorize! :create_commit_status, user_project
required_attributes! [:state] required_attributes! [:state]
attrs = attributes_for_keys [:ref, :target_url, :description, :context, :name] attrs = attributes_for_keys [:ref, :target_url, :description, :context, :name]
commit = @project.commit(params[:sha]) commit = @project.commit(params[:sha])
Loading
Loading
Loading
@@ -125,7 +125,7 @@ describe Ci::Commit do
Loading
@@ -125,7 +125,7 @@ describe Ci::Commit do
end end
   
it 'returns all refs' do it 'returns all refs' do
is_expected.to contain_exactly('master', 'develop') is_expected.to contain_exactly('master', 'develop', nil)
end end
end end
   
Loading
@@ -225,9 +225,10 @@ describe Ci::Commit do
Loading
@@ -225,9 +225,10 @@ describe Ci::Commit do
it 'rebuilds commit' do it 'rebuilds commit' do
expect(commit.status).to eq('skipped') expect(commit.status).to eq('skipped')
expect(create_builds(trigger_request)).to be_truthy expect(create_builds(trigger_request)).to be_truthy
commit.builds.reload
expect(commit.builds.size).to eq(2) # since everything in Ci::Commit is cached we need to fetch a new object
expect(commit.status).to eq('pending') new_commit = Ci::Commit.find_by_id(commit.id)
expect(new_commit.status).to eq('pending')
end end
end end
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment