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
b7120853
Commit
b7120853
authored
Oct 10, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '38941-lock-note-fix' into 'master'
Fix text for the merge request lock system note Closes #38941 See merge request gitlab-org/gitlab-ce!14779
parents
9f1c9b3d
616d1e10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
3 deletions
+41
-3
system_note_service.rb
app/services/system_note_service.rb
+1
-1
update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+2
-2
system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+38
-0
No files found.
app/services/system_note_service.rb
View file @
b7120853
...
...
@@ -593,7 +593,7 @@ module SystemNoteService
def
discussion_lock
(
issuable
,
author
)
action
=
issuable
.
discussion_locked?
?
'locked'
:
'unlocked'
body
=
"
#{
action
}
this
issue
"
body
=
"
#{
action
}
this
#{
issuable
.
class
.
to_s
.
titleize
.
downcase
}
"
create_note
(
NoteSummary
.
new
(
issuable
,
issuable
.
project
,
author
,
body
,
action:
action
))
end
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
b7120853
...
...
@@ -127,10 +127,10 @@ describe MergeRequests::UpdateService, :mailer do
end
it
'creates system note about discussion lock'
do
note
=
find_note
(
'locked this
issue
'
)
note
=
find_note
(
'locked this
merge request
'
)
expect
(
note
).
not_to
be_nil
expect
(
note
.
note
).
to
eq
'locked this
issue
'
expect
(
note
.
note
).
to
eq
'locked this
merge request
'
end
context
'when not including source branch removal options'
do
...
...
spec/services/system_note_service_spec.rb
View file @
b7120853
...
...
@@ -1145,4 +1145,42 @@ describe SystemNoteService do
it
{
expect
(
subject
.
note
).
to
eq
"marked
#{
duplicate_issue
.
to_reference
(
project
)
}
as a duplicate of this issue"
}
end
end
describe
'.discussion_lock'
do
subject
{
described_class
.
discussion_lock
(
noteable
,
author
)
}
context
'discussion unlocked'
do
it_behaves_like
'a system note'
do
let
(
:action
)
{
'unlocked'
}
end
it
'creates the note text correctly'
do
[
:issue
,
:merge_request
].
each
do
|
type
|
issuable
=
create
(
type
)
expect
(
described_class
.
discussion_lock
(
issuable
,
author
).
note
)
.
to
eq
(
"unlocked this
#{
type
.
to_s
.
titleize
.
downcase
}
"
)
end
end
end
context
'discussion locked'
do
before
do
noteable
.
update_attribute
(
:discussion_locked
,
true
)
end
it_behaves_like
'a system note'
do
let
(
:action
)
{
'locked'
}
end
it
'creates the note text correctly'
do
[
:issue
,
:merge_request
].
each
do
|
type
|
issuable
=
create
(
type
,
discussion_locked:
true
)
expect
(
described_class
.
discussion_lock
(
issuable
,
author
).
note
)
.
to
eq
(
"locked this
#{
type
.
to_s
.
titleize
.
downcase
}
"
)
end
end
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