Commit 5b8613b8 authored by Tomasz Maczukin's avatar Tomasz Maczukin

Add test with inactive error use case for 'POST /ci/api/v1/builds/register.json'

parent f369e62a
...@@ -30,5 +30,9 @@ FactoryGirl.define do ...@@ -30,5 +30,9 @@ FactoryGirl.define do
trait :shared do trait :shared do
is_shared true is_shared true
end end
trait :inactive do
active false
end
end end
end end
...@@ -158,6 +158,16 @@ describe Ci::API::API do ...@@ -158,6 +158,16 @@ describe Ci::API::API do
end end
end end
context 'when runner is paused' do
let(:inactive_runner) { create(:ci_runner, :inactive, token: "InactiveRunner") }
before do
register_builds inactive_runner.token
end
it { expect(response).to have_http_status 404 }
end
def register_builds(token = runner.token, **params) def register_builds(token = runner.token, **params)
post ci_api("/builds/register"), params.merge(token: token), { 'User-Agent' => user_agent } post ci_api("/builds/register"), params.merge(token: token), { 'User-Agent' => user_agent }
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