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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
616d1e10
Commit
616d1e10
authored
Oct 10, 2017
by
Jarka Kadlecova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix text for the merge request lock system note
parent
100a7c6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
3 deletions
+41
-3
app/services/system_note_service.rb
app/services/system_note_service.rb
+1
-1
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+2
-2
spec/services/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 @
616d1e10
...
...
@@ -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 @
616d1e10
...
...
@@ -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 @
616d1e10
...
...
@@ -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