diff options
-rw-r--r-- | spec/factories/ci/runners.rb | 4 | ||||
-rw-r--r-- | spec/requests/ci/api/builds_spec.rb | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/spec/factories/ci/runners.rb b/spec/factories/ci/runners.rb index 5b645fab32e..45eaebb2576 100644 --- a/spec/factories/ci/runners.rb +++ b/spec/factories/ci/runners.rb @@ -30,5 +30,9 @@ FactoryGirl.define do trait :shared do is_shared true end + + trait :inactive do + active false + end end end diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb index 9b808457dc0..780bd7f2859 100644 --- a/spec/requests/ci/api/builds_spec.rb +++ b/spec/requests/ci/api/builds_spec.rb @@ -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 |