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
8a69e7d8
Commit
8a69e7d8
authored
Sep 20, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add issue link to issue opened by integration message
parent
d67081e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
app/models/project_services/chat_message/issue_message.rb
app/models/project_services/chat_message/issue_message.rb
+3
-7
spec/models/project_services/chat_message/issue_message_spec.rb
...odels/project_services/chat_message/issue_message_spec.rb
+2
-2
No files found.
app/models/project_services/chat_message/issue_message.rb
View file @
8a69e7d8
...
...
@@ -41,15 +41,11 @@ module ChatMessage
private
def
message
if
opened_issue?
"[
#{
project_link
}
] Issue
#{
state
}
by
#{
user_combined_name
}
"
else
"[
#{
project_link
}
] Issue
#{
issue_link
}
#{
state
}
by
#{
user_combined_name
}
"
end
end
def
opened_issue?
action
==
"open"
action
==
'open'
end
def
description_message
...
...
@@ -57,7 +53,7 @@ module ChatMessage
title:
issue_title
,
title_link:
issue_url
,
text:
format
(
description
),
color:
"#C95823"
color:
'#C95823'
}]
end
...
...
spec/models/project_services/chat_message/issue_message_spec.rb
View file @
8a69e7d8
...
...
@@ -44,7 +44,7 @@ RSpec.describe ChatMessage::IssueMessage do
context
'open'
do
it
'returns a message regarding opening of issues'
do
expect
(
subject
.
pretext
).
to
eq
(
'[<http://somewhere.com|project_name>] Issue opened by Test User (test.user)'
)
'[<http://somewhere.com|project_name>] Issue
<http://url.com|#100 Issue title>
opened by Test User (test.user)'
)
expect
(
subject
.
attachments
).
to
eq
([
{
title:
"#100 Issue title"
,
...
...
@@ -91,7 +91,7 @@ RSpec.describe ChatMessage::IssueMessage do
context
'open'
do
it
'returns a message regarding opening of issues'
do
expect
(
subject
.
pretext
).
to
eq
(
'[[project_name](http://somewhere.com)] Issue opened by Test User (test.user)'
)
'[[project_name](http://somewhere.com)] Issue
[#100 Issue title](http://url.com)
opened by Test User (test.user)'
)
expect
(
subject
.
attachments
).
to
eq
(
'issue description'
)
expect
(
subject
.
activity
).
to
eq
({
title:
'Issue opened by Test User (test.user)'
,
...
...
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