Ensure that we can remove degenerate runners

This commit is contained in:
Kamil Trzciński 2018-05-28 13:44:37 +02:00 committed by Dylan Griffith
parent 5805e92299
commit adc860ae0e
1 changed files with 16 additions and 0 deletions

View File

@ -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