diff options
author | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-05-28 14:44:37 +0300 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-31 11:56:41 +0300 |
commit | adc860ae0e1113e01a586958d41f5916c713e5b5 (patch) | |
tree | ead779d448abc9f5872c1e849eba033a02788068 /spec/models/ci/runner_spec.rb | |
parent | 5805e92299f91a8d849418a03ed0e6cbcbbb5568 (diff) |
Ensure that we can remove degenerate runners
Diffstat (limited to 'spec/models/ci/runner_spec.rb')
-rw-r--r-- | spec/models/ci/runner_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 2f254956f92..b808eb84b58 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -764,4 +764,20 @@ describe Ci::Runner do end end end + + describe 'project runner without projects is destroyable' do + subject { create(:ci_runner, :project) } + + before do + subject.runner_projects.delete_all + end + + it 'does not have projects' do + expect(subject.runner_projects).to be_empty + end + + it 'can be destroyed' do + expect { subject.destroy }.to change { Ci::Runner.count }.by(-1) + end + end end |