Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0e84283b
Commit
0e84283b
authored
Jul 31, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
9de42c97
de2962ec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
app/models/note.rb
app/models/note.rb
+4
-0
changelogs/unreleased/sh-fix-special-role-error-500.yml
changelogs/unreleased/sh-fix-special-role-error-500.yml
+5
-0
spec/models/note_spec.rb
spec/models/note_spec.rb
+16
-0
No files found.
app/models/note.rb
View file @
0e84283b
...
...
@@ -27,6 +27,10 @@ class Note < ApplicationRecord
def
values
constants
.
map
{
|
const
|
self
.
const_get
(
const
)}
end
def
value?
(
val
)
values
.
include?
(
val
)
end
end
end
...
...
changelogs/unreleased/sh-fix-special-role-error-500.yml
0 → 100644
View file @
0e84283b
---
title
:
Fix first-time contributor notes not rendering
merge_request
:
31340
author
:
type
:
fixed
spec/models/note_spec.rb
View file @
0e84283b
...
...
@@ -913,6 +913,22 @@ describe Note do
end
end
describe
'#special_role='
do
let
(
:role
)
{
Note
::
SpecialRole
::
FIRST_TIME_CONTRIBUTOR
}
it
'assigns role'
do
subject
.
special_role
=
role
expect
(
subject
.
special_role
).
to
eq
(
role
)
end
it
'does not assign unknown role'
do
expect
{
subject
.
special_role
=
:bogus
}.
to
raise_error
(
/Role is undefined/
)
expect
(
subject
.
special_role
).
to
be_nil
end
end
describe
'#parent'
do
it
'returns project for project notes'
do
project
=
create
(
:project
)
...
...
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