Commit e6c83b1c authored by Lin Jen-Shin's avatar Lin Jen-Shin

Just set the status rather than calling event

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8091#note_20239558
parent 1e2e0de9
...@@ -251,9 +251,7 @@ describe Ci::API::Builds do ...@@ -251,9 +251,7 @@ describe Ci::API::Builds do
describe 'PATCH /builds/:id/trace.txt' do describe 'PATCH /builds/:id/trace.txt' do
let(:build) do let(:build) do
attributes = {runner_id: runner.id, pipeline: pipeline} attributes = {runner_id: runner.id, pipeline: pipeline}
create(:ci_build, :pending, :trace, attributes) do |build| create(:ci_build, :running, :trace, attributes)
build.run
end
end end
let(:headers) { { Ci::API::Helpers::BUILD_TOKEN_HEADER => build.token, 'Content-Type' => 'text/plain' } } let(:headers) { { Ci::API::Helpers::BUILD_TOKEN_HEADER => build.token, 'Content-Type' => 'text/plain' } }
...@@ -338,8 +336,7 @@ describe Ci::API::Builds do ...@@ -338,8 +336,7 @@ describe Ci::API::Builds do
context 'when project for the build has been deleted' do context 'when project for the build has been deleted' do
let(:build) do let(:build) do
attributes = {runner_id: runner.id, pipeline: pipeline} attributes = {runner_id: runner.id, pipeline: pipeline}
create(:ci_build, :pending, :trace, attributes) do |build| create(:ci_build, :running, :trace, attributes) do |build|
build.run
build.project.update(pending_delete: true) build.project.update(pending_delete: true)
end 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