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
727412ab
Commit
727412ab
authored
Mar 29, 2017
by
Jarka Kadlecova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create system note metadata - EE specific
parent
752d447e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
app/models/system_note_metadata.rb
app/models/system_note_metadata.rb
+1
-1
app/services/system_note_service.rb
app/services/system_note_service.rb
+3
-2
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+9
-3
No files found.
app/models/system_note_metadata.rb
View file @
727412ab
class
SystemNoteMetadata
<
ActiveRecord
::
Base
ICON_TYPES
=
%w[
commit merge confidentiality status label assignee cross_reference
title time_tracking branch milestone discussion task moved
title time_tracking branch milestone discussion task moved
approvals
]
.
freeze
validates
:note
,
presence:
true
...
...
app/services/system_note_service.rb
View file @
727412ab
...
...
@@ -482,12 +482,13 @@ module SystemNoteService
def
approve_mr
(
noteable
,
user
)
body
=
"approved this merge request"
create_note
(
noteable:
noteable
,
project:
noteable
.
project
,
author:
user
,
note:
body
)
create_note
(
NoteSummary
.
new
(
noteable
,
noteable
.
project
,
user
,
body
,
action:
'approvals'
)
)
end
def
unapprove_mr
(
noteable
,
user
)
body
=
"unapproved this merge request"
create_note
(
noteable:
noteable
,
project:
noteable
.
project
,
author:
user
,
note:
body
)
create_note
(
NoteSummary
.
new
(
noteable
,
noteable
.
project
,
user
,
body
,
action:
'approvals'
))
end
private
...
...
spec/services/system_note_service_spec.rb
View file @
727412ab
...
...
@@ -794,7 +794,9 @@ describe SystemNoteService, services: true do
let
(
:noteable
)
{
create
(
:merge_request
,
source_project:
project
)
}
subject
{
described_class
.
approve_mr
(
noteable
,
author
)
}
it_behaves_like
'a system note'
it_behaves_like
'a system note'
do
let
(
:action
)
{
'approvals'
}
end
context
'when merge request approved'
do
it
'sets the note text'
do
...
...
@@ -806,7 +808,9 @@ describe SystemNoteService, services: true do
describe
'.change_time_estimate'
do
subject
{
described_class
.
change_time_estimate
(
noteable
,
project
,
author
)
}
it_behaves_like
'a system note'
it_behaves_like
'a system note'
do
let
(
:action
)
{
'time_tracking'
}
end
context
'with a time estimate'
do
it
'sets the note text'
do
...
...
@@ -836,7 +840,9 @@ describe SystemNoteService, services: true do
described_class
.
change_time_spent
(
noteable
,
project
,
author
)
end
it_behaves_like
'a system note'
it_behaves_like
'a system note'
do
let
(
:action
)
{
'time_tracking'
}
end
context
'when time was added'
do
it
'sets the note text'
do
...
...
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