diff options
author | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-14 15:54:47 +0200 |
---|---|---|
committer | Dylan Griffith <dyl.griffith@gmail.com> | 2018-05-31 10:46:19 +0200 |
commit | 0a2f5065f26f259ed66359f3754ecc21505fea0d (patch) | |
tree | fac04c5b46e13121b8b0b95a62791ae1947e93ba /spec | |
parent | ab489d293d6ee3e30673817ce4652c7b413988c0 (diff) | |
download | gitlab-ce-0a2f5065f26f259ed66359f3754ecc21505fea0d.tar.gz |
Ensure we validate Runner#runner_type when persisting RunnerNamespace
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/ci/runner_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 4dc990350d2..51d5e666cd6 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -66,6 +66,13 @@ describe Ci::Runner do expect(instance_runner).not_to be_valid expect(instance_runner.errors.full_messages).to include('Runner cannot assign project to a non-project runner') end + + it 'should fail to save a group assigned to a project runner even if the runner is already saved' do + group_runner + + expect { create(:group, runners: [project_runner]) } + .to raise_error(ActiveRecord::RecordInvalid) + end end end |