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
16068f3b
Commit
16068f3b
authored
Jul 03, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test if reopen notifications are sent.
parent
310231db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+0
-1
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+38
-0
No files found.
app/mailers/emails/merge_requests.rb
View file @
16068f3b
...
...
@@ -49,7 +49,6 @@ module Emails
@updated_by
=
User
.
find
updated_by_user_id
@target_url
=
project_merge_request_url
(
@project
,
@merge_request
)
set_reference
(
"merge_request_
#{
merge_request_id
}
"
)
mail
(
from:
sender
(
updated_by_user_id
),
to:
recipient
(
recipient_id
),
subject:
subject
(
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)
#{
@mr_status
}
"
))
...
...
spec/services/notification_service_spec.rb
View file @
16068f3b
...
...
@@ -242,6 +242,26 @@ describe NotificationService do
Notify
.
should_not_receive
(
:closed_issue_email
).
with
(
user_id
,
issue
.
id
,
@u_disabled
.
id
)
end
end
describe
:reopen_issue
do
it
'should send email to issue assignee and issue author'
do
should_email
(
issue
.
assignee_id
)
should_email
(
issue
.
author_id
)
should_email
(
@u_watcher
.
id
)
should_not_email
(
@u_participating
.
id
)
should_not_email
(
@u_disabled
.
id
)
notification
.
reopen_issue
(
issue
,
@u_disabled
)
end
def
should_email
(
user_id
)
Notify
.
should_receive
(
:issue_status_changed_email
).
with
(
user_id
,
issue
.
id
,
'reopened'
,
@u_disabled
.
id
)
end
def
should_not_email
(
user_id
)
Notify
.
should_not_receive
(
:issue_status_changed_email
).
with
(
user_id
,
issue
.
id
,
'reopened'
,
@u_disabled
.
id
)
end
end
end
describe
'Merge Requests'
do
...
...
@@ -322,6 +342,24 @@ describe NotificationService do
Notify
.
should_not_receive
(
:merged_merge_request_email
).
with
(
user_id
,
merge_request
.
id
,
@u_disabled
.
id
)
end
end
describe
:reopen_merge_request
do
it
do
should_email
(
merge_request
.
assignee_id
)
should_email
(
@u_watcher
.
id
)
should_not_email
(
@u_participating
.
id
)
should_not_email
(
@u_disabled
.
id
)
notification
.
reopen_mr
(
merge_request
,
@u_disabled
)
end
def
should_email
(
user_id
)
Notify
.
should_receive
(
:merge_request_status_email
).
with
(
user_id
,
merge_request
.
id
,
'reopened'
,
@u_disabled
.
id
)
end
def
should_not_email
(
user_id
)
Notify
.
should_not_receive
(
:merge_request_status_email
).
with
(
user_id
,
merge_request
.
id
,
'reopened'
,
@u_disabled
.
id
)
end
end
end
describe
'Projects'
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