BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0a2f5065
Commit
0a2f5065
authored
May 14, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure we validate Runner#runner_type when persisting RunnerNamespace
parent
ab489d29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
runner_namespace.rb
app/models/ci/runner_namespace.rb
+1
-1
runner_spec.rb
spec/models/ci/runner_spec.rb
+7
-0
No files found.
app/models/ci/runner_namespace.rb
View file @
0a2f5065
...
...
@@ -2,7 +2,7 @@ module Ci
class
RunnerNamespace
<
ActiveRecord
::
Base
extend
Gitlab
::
Ci
::
Model
belongs_to
:runner
belongs_to
:runner
,
validate:
true
belongs_to
:namespace
,
class_name:
'::Namespace'
belongs_to
:group
,
class_name:
'::Group'
,
foreign_key: :namespace_id
end
...
...
spec/models/ci/runner_spec.rb
View file @
0a2f5065
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment