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
8d1b82ac
Commit
8d1b82ac
authored
Apr 18, 2016
by
Ben Bodenmiller
Committed by
Yorick Peterse
Apr 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format merge request references properly
parent
f6fbd0fb
Changes
24
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
37 additions
and
36 deletions
+37
-36
CHANGELOG
CHANGELOG
+1
-0
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+1
-1
app/mailers/emails/notes.rb
app/mailers/emails/notes.rb
+1
-1
app/models/project_services/hipchat_service.rb
app/models/project_services/hipchat_service.rb
+2
-2
app/models/project_services/slack_service/merge_message.rb
app/models/project_services/slack_service/merge_message.rb
+1
-1
app/models/project_services/slack_service/note_message.rb
app/models/project_services/slack_service/note_message.rb
+1
-1
app/views/notify/closed_merge_request_email.html.haml
app/views/notify/closed_merge_request_email.html.haml
+1
-1
app/views/notify/closed_merge_request_email.text.haml
app/views/notify/closed_merge_request_email.text.haml
+1
-1
app/views/notify/merge_request_status_email.html.haml
app/views/notify/merge_request_status_email.html.haml
+1
-1
app/views/notify/merge_request_status_email.text.haml
app/views/notify/merge_request_status_email.text.haml
+1
-1
app/views/notify/merged_merge_request_email.html.haml
app/views/notify/merged_merge_request_email.html.haml
+1
-1
app/views/notify/merged_merge_request_email.text.haml
app/views/notify/merged_merge_request_email.text.haml
+1
-1
app/views/notify/new_merge_request_email.text.erb
app/views/notify/new_merge_request_email.text.erb
+1
-1
app/views/notify/note_merge_request_email.text.erb
app/views/notify/note_merge_request_email.text.erb
+1
-1
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+1
-1
app/views/projects/merge_requests/edit.html.haml
app/views/projects/merge_requests/edit.html.haml
+2
-2
app/views/projects/merge_requests/invalid.html.haml
app/views/projects/merge_requests/invalid.html.haml
+1
-1
app/views/search/results/_merge_request.html.haml
app/views/search/results/_merge_request.html.haml
+1
-1
features/steps/dashboard/todos.rb
features/steps/dashboard/todos.rb
+5
-5
features/steps/project/forked_merge_requests.rb
features/steps/project/forked_merge_requests.rb
+1
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+6
-6
spec/models/project_services/hipchat_service_spec.rb
spec/models/project_services/hipchat_service_spec.rb
+2
-2
spec/models/project_services/slack_service/merge_message_spec.rb
...dels/project_services/slack_service/merge_message_spec.rb
+2
-2
spec/models/project_services/slack_service/note_message_spec.rb
...odels/project_services/slack_service/note_message_spec.rb
+1
-1
No files found.
CHANGELOG
View file @
8d1b82ac
...
@@ -87,6 +87,7 @@ v 8.7.0 (unreleased)
...
@@ -87,6 +87,7 @@ v 8.7.0 (unreleased)
- Fix emoji categories in the emoji picker
- Fix emoji categories in the emoji picker
- API: Properly display annotated tags for GET /projects/:id/repository/tags (Robert Schilling)
- API: Properly display annotated tags for GET /projects/:id/repository/tags (Robert Schilling)
- Add encrypted credentials for imported projects and migrate old ones
- Add encrypted credentials for imported projects and migrate old ones
- Properly format all merge request references with ! rather than # !3740 (Ben Bodenmiller)
- Author and participants are displayed first on users autocompletion
- Author and participants are displayed first on users autocompletion
- Show number sign on external issue reference text (Florent Baldino)
- Show number sign on external issue reference text (Florent Baldino)
- Updated print style for issues
- Updated print style for issues
...
...
app/mailers/emails/merge_requests.rb
View file @
8d1b82ac
...
@@ -56,7 +56,7 @@ module Emails
...
@@ -56,7 +56,7 @@ module Emails
{
{
from:
sender
(
sender_id
),
from:
sender
(
sender_id
),
to:
recipient
(
recipient_id
),
to:
recipient
(
recipient_id
),
subject:
subject
(
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)"
)
subject:
subject
(
"
#{
@merge_request
.
title
}
(
#
{
@merge_request
.
to_reference
}
)"
)
}
}
end
end
end
end
...
...
app/mailers/emails/notes.rb
View file @
8d1b82ac
...
@@ -38,7 +38,7 @@ module Emails
...
@@ -38,7 +38,7 @@ module Emails
{
{
from:
sender
(
@note
.
author_id
),
from:
sender
(
@note
.
author_id
),
to:
recipient
(
recipient_id
),
to:
recipient
(
recipient_id
),
subject:
subject
(
"
#{
@note
.
noteable
.
title
}
(#
#{
@note
.
noteable
.
iid
}
)"
)
subject:
subject
(
"
#{
@note
.
noteable
.
title
}
(
#
{
@note
.
noteable
.
to_reference
}
)"
)
}
}
end
end
...
...
app/models/project_services/hipchat_service.rb
View file @
8d1b82ac
...
@@ -183,7 +183,7 @@ class HipchatService < Service
...
@@ -183,7 +183,7 @@ class HipchatService < Service
title
=
obj_attr
[
:title
]
title
=
obj_attr
[
:title
]
merge_request_url
=
"
#{
project_url
}
/merge_requests/
#{
merge_request_id
}
"
merge_request_url
=
"
#{
project_url
}
/merge_requests/
#{
merge_request_id
}
"
merge_request_link
=
"<a href=
\"
#{
merge_request_url
}
\"
>merge request
#
#{
merge_request_id
}
</a>"
merge_request_link
=
"<a href=
\"
#{
merge_request_url
}
\"
>merge request
!
#{
merge_request_id
}
</a>"
message
=
"
#{
user_name
}
#{
state
}
#{
merge_request_link
}
in "
\
message
=
"
#{
user_name
}
#{
state
}
#{
merge_request_link
}
in "
\
"
#{
project_link
}
: <b>
#{
title
}
</b>"
"
#{
project_link
}
: <b>
#{
title
}
</b>"
...
@@ -224,7 +224,7 @@ class HipchatService < Service
...
@@ -224,7 +224,7 @@ class HipchatService < Service
when
"MergeRequest"
when
"MergeRequest"
subj_attr
=
HashWithIndifferentAccess
.
new
(
data
[
:merge_request
])
subj_attr
=
HashWithIndifferentAccess
.
new
(
data
[
:merge_request
])
subject_id
=
subj_attr
[
:iid
]
subject_id
=
subj_attr
[
:iid
]
subject_desc
=
"
#
#{
subject_id
}
"
subject_desc
=
"
!
#{
subject_id
}
"
subject_type
=
"merge request"
subject_type
=
"merge request"
title
=
format_title
(
subj_attr
[
:title
])
title
=
format_title
(
subj_attr
[
:title
])
when
"Snippet"
when
"Snippet"
...
...
app/models/project_services/slack_service/merge_message.rb
View file @
8d1b82ac
...
@@ -50,7 +50,7 @@ class SlackService
...
@@ -50,7 +50,7 @@ class SlackService
end
end
def
merge_request_link
def
merge_request_link
"[merge request
#
#{
merge_request_id
}
](
#{
merge_request_url
}
)"
"[merge request
!
#{
merge_request_id
}
](
#{
merge_request_url
}
)"
end
end
def
merge_request_url
def
merge_request_url
...
...
app/models/project_services/slack_service/note_message.rb
View file @
8d1b82ac
...
@@ -58,7 +58,7 @@ class SlackService
...
@@ -58,7 +58,7 @@ class SlackService
def
create_merge_note
(
merge_request
)
def
create_merge_note
(
merge_request
)
commented_on_message
(
commented_on_message
(
"[merge request
#
#{
merge_request
[
:iid
]
}
](
#{
@note_url
}
)"
,
"[merge request
!
#{
merge_request
[
:iid
]
}
](
#{
@note_url
}
)"
,
format_title
(
merge_request
[
:title
]))
format_title
(
merge_request
[
:title
]))
end
end
...
...
app/views/notify/closed_merge_request_email.html.haml
View file @
8d1b82ac
%p
%p
=
"Merge Request #
#{
@merge_request
.
iid
}
was closed by
#{
@updated_by
.
name
}
"
=
"Merge Request
#
{
@merge_request
.
to_reference
}
was closed by
#{
@updated_by
.
name
}
"
app/views/notify/closed_merge_request_email.text.haml
View file @
8d1b82ac
=
"Merge Request #
#{
@merge_request
.
iid
}
was closed by
#{
@updated_by
.
name
}
"
=
"Merge Request
#
{
@merge_request
.
to_reference
}
was closed by
#{
@updated_by
.
name
}
"
Merge Request url:
#{
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
)
}
Merge Request url:
#{
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
)
}
...
...
app/views/notify/merge_request_status_email.html.haml
View file @
8d1b82ac
%p
%p
=
"Merge Request #
#{
@merge_request
.
iid
}
was
#{
@mr_status
}
by
#{
@updated_by
.
name
}
"
=
"Merge Request
#
{
@merge_request
.
to_reference
}
was
#{
@mr_status
}
by
#{
@updated_by
.
name
}
"
app/views/notify/merge_request_status_email.text.haml
View file @
8d1b82ac
=
"Merge Request #
#{
@merge_request
.
iid
}
was
#{
@mr_status
}
by
#{
@updated_by
.
name
}
"
=
"Merge Request
#
{
@merge_request
.
to_reference
}
was
#{
@mr_status
}
by
#{
@updated_by
.
name
}
"
Merge Request url:
#{
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
)
}
Merge Request url:
#{
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
)
}
...
...
app/views/notify/merged_merge_request_email.html.haml
View file @
8d1b82ac
%p
%p
=
"Merge Request #
#{
@merge_request
.
iid
}
was merged"
=
"Merge Request
#
{
@merge_request
.
to_reference
}
was merged"
app/views/notify/merged_merge_request_email.text.haml
View file @
8d1b82ac
=
"Merge Request #
#{
@merge_request
.
iid
}
was merged"
=
"Merge Request
#
{
@merge_request
.
to_reference
}
was merged"
Merge Request url:
#{
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
)
}
Merge Request url:
#{
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
)
}
...
...
app/views/notify/new_merge_request_email.text.erb
View file @
8d1b82ac
New Merge Request
#
<%=
@merge_request
.
iid
%>
New Merge Request
<%=
@merge_request
.
to_reference
%>
<%=
url_for
(
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
))
%>
<%=
url_for
(
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
))
%>
...
...
app/views/notify/note_merge_request_email.text.erb
View file @
8d1b82ac
New comment for Merge Request
<%=
@merge_request
.
iid
%>
New comment for Merge Request
<%=
@merge_request
.
to_reference
%>
<%=
url_for
(
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
,
anchor:
"note_
#{
@note
.
id
}
"
))
%>
<%=
url_for
(
namespace_project_merge_request_url
(
@merge_request
.
target_project
.
namespace
,
@merge_request
.
target_project
,
@merge_request
,
anchor:
"note_
#{
@note
.
id
}
"
))
%>
...
...
app/views/projects/builds/show.html.haml
View file @
8d1b82ac
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
-
merge_request
=
@build
.
merge_request
-
merge_request
=
@build
.
merge_request
-
if
merge_request
-
if
merge_request
via
via
=
link_to
"merge request #
#{
merge_request
.
iid
}
"
,
merge_request_path
(
merge_request
)
=
link_to
"merge request
#
{
merge_request
.
to_reference
}
"
,
merge_request_path
(
merge_request
)
#up-build-trace
#up-build-trace
-
builds
=
@build
.
commit
.
matrix_builds
(
@build
)
-
builds
=
@build
.
commit
.
matrix_builds
(
@build
)
...
...
app/views/projects/merge_requests/edit.html.haml
View file @
8d1b82ac
-
page_title
"Edit"
,
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)
"
,
"Merge Requests"
-
page_title
"Edit"
,
"
#{
@merge_request
.
title
}
(
#
{
@merge_request
.
to_reference
}
"
,
"Merge Requests"
=
render
"header_title"
=
render
"header_title"
%h3
.page-title
%h3
.page-title
Edit Merge Request #
#{@merge_request.iid
}
Edit Merge Request
#
{
@merge_request
.
to_reference
}
%hr
%hr
=
render
'form'
=
render
'form'
app/views/projects/merge_requests/invalid.html.haml
View file @
8d1b82ac
-
page_title
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)
"
,
"Merge Requests"
-
page_title
"
#{
@merge_request
.
title
}
(
#
{
merge_request
.
to_reference
}
"
,
"Merge Requests"
=
render
"header_title"
=
render
"header_title"
.merge-request
.merge-request
...
...
app/views/search/results/_merge_request.html.haml
View file @
8d1b82ac
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
%h4
%h4
=
link_to
[
merge_request
.
target_project
.
namespace
.
becomes
(
Namespace
),
merge_request
.
target_project
,
merge_request
]
do
=
link_to
[
merge_request
.
target_project
.
namespace
.
becomes
(
Namespace
),
merge_request
.
target_project
,
merge_request
]
do
%span
.term.str-truncated
=
merge_request
.
title
%span
.term.str-truncated
=
merge_request
.
title
.pull-right
#
#{merge_request.iid
}
.pull-right
#
{
merge_request
.
to_reference
}
-
if
merge_request
.
description
.
present?
-
if
merge_request
.
description
.
present?
.description.term
.description.term
=
preserve
do
=
preserve
do
...
...
features/steps/dashboard/todos.rb
View file @
8d1b82ac
...
@@ -31,7 +31,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
...
@@ -31,7 +31,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
expect
(
page
).
to
have_content
'Done 0'
expect
(
page
).
to
have_content
'Done 0'
expect
(
page
).
to
have_link
project
.
name_with_namespace
expect
(
page
).
to
have_link
project
.
name_with_namespace
should_see_todo
(
1
,
"John Doe assigned you merge request
!
#{
merge_request
.
iid
}
"
,
merge_request
.
title
)
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
,
merge_request
.
title
)
should_see_todo
(
2
,
"John Doe mentioned you on issue #
#{
issue
.
iid
}
"
,
"
#{
current_user
.
to_reference
}
Wdyt?"
)
should_see_todo
(
2
,
"John Doe mentioned you on issue #
#{
issue
.
iid
}
"
,
"
#{
current_user
.
to_reference
}
Wdyt?"
)
should_see_todo
(
3
,
"John Doe assigned you issue #
#{
issue
.
iid
}
"
,
issue
.
title
)
should_see_todo
(
3
,
"John Doe assigned you issue #
#{
issue
.
iid
}
"
,
issue
.
title
)
should_see_todo
(
4
,
"Mary Jane mentioned you on issue #
#{
issue
.
iid
}
"
,
issue
.
title
)
should_see_todo
(
4
,
"Mary Jane mentioned you on issue #
#{
issue
.
iid
}
"
,
issue
.
title
)
...
@@ -45,7 +45,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
...
@@ -45,7 +45,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
page
.
within
(
'.nav-sidebar'
)
{
expect
(
page
).
to
have_content
'Todos 3'
}
page
.
within
(
'.nav-sidebar'
)
{
expect
(
page
).
to
have_content
'Todos 3'
}
expect
(
page
).
to
have_content
'To do 3'
expect
(
page
).
to
have_content
'To do 3'
expect
(
page
).
to
have_content
'Done 1'
expect
(
page
).
to
have_content
'Done 1'
should_not_see_todo
"John Doe assigned you merge request
!
#{
merge_request
.
iid
}
"
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
end
end
step
'I click on the "Done" tab'
do
step
'I click on the "Done" tab'
do
...
@@ -54,7 +54,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
...
@@ -54,7 +54,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
step
'I should see all todos marked as done'
do
step
'I should see all todos marked as done'
do
expect
(
page
).
to
have_link
project
.
name_with_namespace
expect
(
page
).
to
have_link
project
.
name_with_namespace
should_see_todo
(
1
,
"John Doe assigned you merge request
!
#{
merge_request
.
iid
}
"
,
merge_request
.
title
,
false
)
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
,
merge_request
.
title
,
false
)
end
end
step
'I filter by "Enterprise"'
do
step
'I filter by "Enterprise"'
do
...
@@ -82,11 +82,11 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
...
@@ -82,11 +82,11 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
end
end
step
'I should not see todos related to "Merge Requests" in the list'
do
step
'I should not see todos related to "Merge Requests" in the list'
do
should_not_see_todo
"John Doe assigned you merge request
!
#{
merge_request
.
iid
}
"
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
end
end
step
'I should not see todos related to "Assignments" in the list'
do
step
'I should not see todos related to "Assignments" in the list'
do
should_not_see_todo
"John Doe assigned you merge request
!
#{
merge_request
.
iid
}
"
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
should_not_see_todo
"John Doe assigned you issue #
#{
issue
.
iid
}
"
should_not_see_todo
"John Doe assigned you issue #
#{
issue
.
iid
}
"
end
end
...
...
features/steps/project/forked_merge_requests.rb
View file @
8d1b82ac
...
@@ -114,7 +114,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
...
@@ -114,7 +114,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
step
'I see the edit page prefilled for "Merge Request On Forked Project"'
do
step
'I see the edit page prefilled for "Merge Request On Forked Project"'
do
expect
(
current_path
).
to
eq
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
expect
(
current_path
).
to
eq
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
expect
(
page
).
to
have_content
"Edit merge request #
#{
@merge_request
.
id
}
"
expect
(
page
).
to
have_content
"Edit merge request
#
{
@merge_request
.
to_reference
}
"
expect
(
find
(
"#merge_request_title"
).
value
).
to
eq
"Merge Request On Forked Project"
expect
(
find
(
"#merge_request_title"
).
value
).
to
eq
"Merge Request On Forked Project"
end
end
...
...
spec/mailers/notify_spec.rb
View file @
8d1b82ac
...
@@ -213,7 +213,7 @@ describe Notify do
...
@@ -213,7 +213,7 @@ describe Notify do
it_behaves_like
'an unsubscribeable thread'
it_behaves_like
'an unsubscribeable thread'
it
'has the correct subject'
do
it
'has the correct subject'
do
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(#
#{
merge_request
.
iid
}
\)/
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(
#
{
merge_request
.
to_reference
}
\)/
end
end
it
'contains a link to the new merge request'
do
it
'contains a link to the new merge request'
do
...
@@ -268,7 +268,7 @@ describe Notify do
...
@@ -268,7 +268,7 @@ describe Notify do
end
end
it
'has the correct subject'
do
it
'has the correct subject'
do
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(#
#{
merge_request
.
iid
}
\)/
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(
#
{
merge_request
.
to_reference
}
\)/
end
end
it
'contains the name of the previous assignee'
do
it
'contains the name of the previous assignee'
do
...
@@ -302,7 +302,7 @@ describe Notify do
...
@@ -302,7 +302,7 @@ describe Notify do
end
end
it
'has the correct subject'
do
it
'has the correct subject'
do
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(#
#{
merge_request
.
iid
}
\)/
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(
#
{
merge_request
.
to_reference
}
\)/
end
end
it
'contains the names of the added labels'
do
it
'contains the names of the added labels'
do
...
@@ -331,7 +331,7 @@ describe Notify do
...
@@ -331,7 +331,7 @@ describe Notify do
end
end
it
'has the correct subject'
do
it
'has the correct subject'
do
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(#
#{
merge_request
.
iid
}
\)/i
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(
#
{
merge_request
.
to_reference
}
\)/i
end
end
it
'contains the new status'
do
it
'contains the new status'
do
...
@@ -364,7 +364,7 @@ describe Notify do
...
@@ -364,7 +364,7 @@ describe Notify do
end
end
it
'has the correct subject'
do
it
'has the correct subject'
do
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(#
#{
merge_request
.
iid
}
\)/
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(
#
{
merge_request
.
to_reference
}
\)/
end
end
it
'contains the new status'
do
it
'contains the new status'
do
...
@@ -502,7 +502,7 @@ describe Notify do
...
@@ -502,7 +502,7 @@ describe Notify do
it_behaves_like
'an unsubscribeable thread'
it_behaves_like
'an unsubscribeable thread'
it
'has the correct subject'
do
it
'has the correct subject'
do
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(#
#{
merge_request
.
iid
}
\)/
is_expected
.
to
have_subject
/
#{
merge_request
.
title
}
\(
#
{
merge_request
.
to_reference
}
\)/
end
end
it
'contains a link to the merge request note'
do
it
'contains a link to the merge request note'
do
...
...
spec/models/project_services/hipchat_service_spec.rb
View file @
8d1b82ac
...
@@ -152,7 +152,7 @@ describe HipchatService, models: true do
...
@@ -152,7 +152,7 @@ describe HipchatService, models: true do
obj_attr
=
merge_sample_data
[
:object_attributes
]
obj_attr
=
merge_sample_data
[
:object_attributes
]
expect
(
message
).
to
eq
(
"
#{
user
.
name
}
opened "
\
expect
(
message
).
to
eq
(
"
#{
user
.
name
}
opened "
\
"<a href=
\"
#{
obj_attr
[
:url
]
}
\"
>merge request
#
#{
obj_attr
[
"iid"
]
}
</a> in "
\
"<a href=
\"
#{
obj_attr
[
:url
]
}
\"
>merge request
!
#{
obj_attr
[
"iid"
]
}
</a> in "
\
"<a href=
\"
#{
project
.
web_url
}
\"
>
#{
project_name
}
</a>: "
\
"<a href=
\"
#{
project
.
web_url
}
\"
>
#{
project_name
}
</a>: "
\
"<b>Awesome merge request</b>"
\
"<b>Awesome merge request</b>"
\
"<pre>please fix</pre>"
)
"<pre>please fix</pre>"
)
...
@@ -202,7 +202,7 @@ describe HipchatService, models: true do
...
@@ -202,7 +202,7 @@ describe HipchatService, models: true do
title
=
data
[
:merge_request
][
'title'
]
title
=
data
[
:merge_request
][
'title'
]
expect
(
message
).
to
eq
(
"
#{
user
.
name
}
commented on "
\
expect
(
message
).
to
eq
(
"
#{
user
.
name
}
commented on "
\
"<a href=
\"
#{
obj_attr
[
:url
]
}
\"
>merge request
#
#{
merge_id
}
</a> in "
\
"<a href=
\"
#{
obj_attr
[
:url
]
}
\"
>merge request
!
#{
merge_id
}
</a> in "
\
"<a href=
\"
#{
project
.
web_url
}
\"
>
#{
project_name
}
</a>: "
\
"<a href=
\"
#{
project
.
web_url
}
\"
>
#{
project_name
}
</a>: "
\
"<b>
#{
title
}
</b>"
\
"<b>
#{
title
}
</b>"
\
"<pre>merge request note</pre>"
)
"<pre>merge request note</pre>"
)
...
...
spec/models/project_services/slack_service/merge_message_spec.rb
View file @
8d1b82ac
...
@@ -31,7 +31,7 @@ describe SlackService::MergeMessage, models: true do
...
@@ -31,7 +31,7 @@ describe SlackService::MergeMessage, models: true do
context
'open'
do
context
'open'
do
it
'returns a message regarding opening of merge requests'
do
it
'returns a message regarding opening of merge requests'
do
expect
(
subject
.
pretext
).
to
eq
(
expect
(
subject
.
pretext
).
to
eq
(
'Test User opened <somewhere.com/merge_requests/100|merge request
#
100> '
\
'Test User opened <somewhere.com/merge_requests/100|merge request
!
100> '
\
'in <somewhere.com|project_name>: *Issue title*'
)
'in <somewhere.com|project_name>: *Issue title*'
)
expect
(
subject
.
attachments
).
to
be_empty
expect
(
subject
.
attachments
).
to
be_empty
end
end
...
@@ -43,7 +43,7 @@ describe SlackService::MergeMessage, models: true do
...
@@ -43,7 +43,7 @@ describe SlackService::MergeMessage, models: true do
end
end
it
'returns a message regarding closing of merge requests'
do
it
'returns a message regarding closing of merge requests'
do
expect
(
subject
.
pretext
).
to
eq
(
expect
(
subject
.
pretext
).
to
eq
(
'Test User closed <somewhere.com/merge_requests/100|merge request
#
100> '
\
'Test User closed <somewhere.com/merge_requests/100|merge request
!
100> '
\
'in <somewhere.com|project_name>: *Issue title*'
)
'in <somewhere.com|project_name>: *Issue title*'
)
expect
(
subject
.
attachments
).
to
be_empty
expect
(
subject
.
attachments
).
to
be_empty
end
end
...
...
spec/models/project_services/slack_service/note_message_spec.rb
View file @
8d1b82ac
...
@@ -63,7 +63,7 @@ describe SlackService::NoteMessage, models: true do
...
@@ -63,7 +63,7 @@ describe SlackService::NoteMessage, models: true do
it
'returns a message regarding notes on a merge request'
do
it
'returns a message regarding notes on a merge request'
do
message
=
SlackService
::
NoteMessage
.
new
(
@args
)
message
=
SlackService
::
NoteMessage
.
new
(
@args
)
expect
(
message
.
pretext
).
to
eq
(
"Test User commented on "
\
expect
(
message
.
pretext
).
to
eq
(
"Test User commented on "
\
"<url|merge request
#
30> in <somewhere.com|project_name>: "
\
"<url|merge request
!
30> in <somewhere.com|project_name>: "
\
"*merge request title*"
)
"*merge request title*"
)
expected_attachments
=
[
expected_attachments
=
[
{
{
...
...
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