Add test with inactive error use case for 'POST /ci/api/v1/builds/register.json'
This commit is contained in:
parent
f369e62a16
commit
5b8613b8e6
2 changed files with 14 additions and 0 deletions
|
@ -30,5 +30,9 @@ FactoryGirl.define do
|
|||
trait :shared do
|
||||
is_shared true
|
||||
end
|
||||
|
||||
trait :inactive do
|
||||
active false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -158,6 +158,16 @@ describe Ci::API::API do
|
|||
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)
|
||||
post ci_api("/builds/register"), params.merge(token: token), { 'User-Agent' => user_agent }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue