Skip to content
Snippets Groups Projects
Commit 92a83aae authored by Lin Jen-Shin's avatar Lin Jen-Shin 🍪
Browse files

Add a test for Ci::Pipeline#cancel_running:

parent b6a7a478
No related branches found
No related tags found
1 merge request!937CE upstream merge
......@@ -454,6 +454,22 @@ def create_build(name, queued_at = current, started_from = 0)
end
end
describe '#cancel_running' do
context 'when there is a running external job and created build' do
before do
create(:generic_commit_status, :running, pipeline: pipeline)
create(:ci_build, :created, pipeline: pipeline)
pipeline.cancel_running
end
it 'cancels both jobs' do
expect(pipeline.statuses.pluck(:status)).
to contain_exactly('canceled', 'canceled')
end
end
end
describe '#execute_hooks' do
let!(:build_a) { create_build('a', 0) }
let!(:build_b) { create_build('b', 1) }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment