Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil TrzciƄski <ayufan@ayufan.eu>2018-05-28 14:44:37 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-31 11:56:41 +0300
commitadc860ae0e1113e01a586958d41f5916c713e5b5 (patch)
treeead779d448abc9f5872c1e849eba033a02788068 /spec/models/ci/runner_spec.rb
parent5805e92299f91a8d849418a03ed0e6cbcbbb5568 (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.rb16
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