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
Tatuya Kamada
gitlab-ce
Commits
230bae9d
Commit
230bae9d
authored
Sep 19, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the other sites for reset_delivered_emails! as well
parent
57258566
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
spec/mailers/shared/notify.rb
spec/mailers/shared/notify.rb
+1
-1
spec/models/project_services/pipeline_email_service_spec.rb
spec/models/project_services/pipeline_email_service_spec.rb
+1
-1
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+14
-14
spec/workers/build_email_worker_spec.rb
spec/workers/build_email_worker_spec.rb
+1
-1
spec/workers/emails_on_push_worker_spec.rb
spec/workers/emails_on_push_worker_spec.rb
+2
-2
No files found.
spec/mailers/shared/notify.rb
View file @
230bae9d
...
@@ -7,7 +7,7 @@ shared_context 'gitlab email notification' do
...
@@ -7,7 +7,7 @@ shared_context 'gitlab email notification' do
let
(
:new_user_address
)
{
'newguy@example.com'
}
let
(
:new_user_address
)
{
'newguy@example.com'
}
before
do
before
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
email
=
recipient
.
emails
.
create
(
email:
"notifications@example.com"
)
email
=
recipient
.
emails
.
create
(
email:
"notifications@example.com"
)
recipient
.
update_attribute
(
:notification_email
,
email
.
email
)
recipient
.
update_attribute
(
:notification_email
,
email
.
email
)
stub_incoming_email_setting
(
enabled:
true
,
address:
"reply+%{key}@
#{
Gitlab
.
config
.
gitlab
.
host
}
"
)
stub_incoming_email_setting
(
enabled:
true
,
address:
"reply+%{key}@
#{
Gitlab
.
config
.
gitlab
.
host
}
"
)
...
...
spec/models/project_services/pipeline_email_service_spec.rb
View file @
230bae9d
...
@@ -13,7 +13,7 @@ describe PipelinesEmailService do
...
@@ -13,7 +13,7 @@ describe PipelinesEmailService do
end
end
before
do
before
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
end
describe
'Validations'
do
describe
'Validations'
do
...
...
spec/services/notification_service_spec.rb
View file @
230bae9d
...
@@ -17,7 +17,7 @@ describe NotificationService, services: true do
...
@@ -17,7 +17,7 @@ describe NotificationService, services: true do
it
'sends no emails when no new mentions are present'
do
it
'sends no emails when no new mentions are present'
do
send_notifications
send_notifications
expect
(
ActionMailer
::
Base
.
deliveries
).
to
be_empty
should_email_no_one
end
end
it
'emails new mentions with a watch level higher than participant'
do
it
'emails new mentions with a watch level higher than participant'
do
...
@@ -27,7 +27,7 @@ describe NotificationService, services: true do
...
@@ -27,7 +27,7 @@ describe NotificationService, services: true do
it
'does not email new mentions with a watch level equal to or less than participant'
do
it
'does not email new mentions with a watch level equal to or less than participant'
do
send_notifications
(
@u_participating
,
@u_mentioned
)
send_notifications
(
@u_participating
,
@u_mentioned
)
expect
(
ActionMailer
::
Base
.
deliveries
).
to
be_empty
should_email_no_one
end
end
end
end
...
@@ -79,7 +79,7 @@ describe NotificationService, services: true do
...
@@ -79,7 +79,7 @@ describe NotificationService, services: true do
# Ensure create SentNotification by noteable = issue 6 times, not noteable = note
# Ensure create SentNotification by noteable = issue 6 times, not noteable = note
expect
(
SentNotification
).
to
receive
(
:record
).
with
(
issue
,
any_args
).
exactly
(
8
).
times
expect
(
SentNotification
).
to
receive
(
:record
).
with
(
issue
,
any_args
).
exactly
(
8
).
times
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
notification
.
new_note
(
note
)
notification
.
new_note
(
note
)
...
@@ -111,7 +111,7 @@ describe NotificationService, services: true do
...
@@ -111,7 +111,7 @@ describe NotificationService, services: true do
context
'participating'
do
context
'participating'
do
context
'by note'
do
context
'by note'
do
before
do
before
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
note
.
author
=
@u_lazy_participant
note
.
author
=
@u_lazy_participant
note
.
save
note
.
save
notification
.
new_note
(
note
)
notification
.
new_note
(
note
)
...
@@ -134,7 +134,7 @@ describe NotificationService, services: true do
...
@@ -134,7 +134,7 @@ describe NotificationService, services: true do
@u_watcher
.
notification_settings_for
(
note
.
project
).
participating!
@u_watcher
.
notification_settings_for
(
note
.
project
).
participating!
@u_watcher
.
notification_settings_for
(
note
.
project
.
group
).
global!
@u_watcher
.
notification_settings_for
(
note
.
project
.
group
).
global!
update_custom_notification
(
:new_note
,
@u_custom_global
)
update_custom_notification
(
:new_note
,
@u_custom_global
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
end
it
do
it
do
...
@@ -173,7 +173,7 @@ describe NotificationService, services: true do
...
@@ -173,7 +173,7 @@ describe NotificationService, services: true do
expect
(
SentNotification
).
to
receive
(
:record
).
with
(
confidential_issue
,
any_args
).
exactly
(
4
).
times
expect
(
SentNotification
).
to
receive
(
:record
).
with
(
confidential_issue
,
any_args
).
exactly
(
4
).
times
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
notification
.
new_note
(
note
)
notification
.
new_note
(
note
)
...
@@ -196,7 +196,7 @@ describe NotificationService, services: true do
...
@@ -196,7 +196,7 @@ describe NotificationService, services: true do
before
do
before
do
build_team
(
note
.
project
)
build_team
(
note
.
project
)
note
.
project
.
team
<<
[
note
.
author
,
:master
]
note
.
project
.
team
<<
[
note
.
author
,
:master
]
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
end
describe
'#new_note'
do
describe
'#new_note'
do
...
@@ -238,7 +238,7 @@ describe NotificationService, services: true do
...
@@ -238,7 +238,7 @@ describe NotificationService, services: true do
before
do
before
do
build_team
(
note
.
project
)
build_team
(
note
.
project
)
note
.
project
.
team
<<
[
note
.
author
,
:master
]
note
.
project
.
team
<<
[
note
.
author
,
:master
]
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
end
describe
'#new_note'
do
describe
'#new_note'
do
...
@@ -273,7 +273,7 @@ describe NotificationService, services: true do
...
@@ -273,7 +273,7 @@ describe NotificationService, services: true do
before
do
before
do
build_team
(
note
.
project
)
build_team
(
note
.
project
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
allow_any_instance_of
(
Commit
).
to
receive
(
:author
).
and_return
(
@u_committer
)
allow_any_instance_of
(
Commit
).
to
receive
(
:author
).
and_return
(
@u_committer
)
update_custom_notification
(
:new_note
,
@u_guest_custom
,
project
)
update_custom_notification
(
:new_note
,
@u_guest_custom
,
project
)
update_custom_notification
(
:new_note
,
@u_custom_global
)
update_custom_notification
(
:new_note
,
@u_custom_global
)
...
@@ -348,7 +348,7 @@ describe NotificationService, services: true do
...
@@ -348,7 +348,7 @@ describe NotificationService, services: true do
before
do
before
do
build_team
(
issue
.
project
)
build_team
(
issue
.
project
)
add_users_with_subscription
(
issue
.
project
,
issue
)
add_users_with_subscription
(
issue
.
project
,
issue
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
update_custom_notification
(
:new_issue
,
@u_guest_custom
,
project
)
update_custom_notification
(
:new_issue
,
@u_guest_custom
,
project
)
update_custom_notification
(
:new_issue
,
@u_custom_global
)
update_custom_notification
(
:new_issue
,
@u_custom_global
)
end
end
...
@@ -408,7 +408,7 @@ describe NotificationService, services: true do
...
@@ -408,7 +408,7 @@ describe NotificationService, services: true do
label
.
toggle_subscription
(
guest
)
label
.
toggle_subscription
(
guest
)
label
.
toggle_subscription
(
admin
)
label
.
toggle_subscription
(
admin
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
notification
.
new_issue
(
confidential_issue
,
@u_disabled
)
notification
.
new_issue
(
confidential_issue
,
@u_disabled
)
...
@@ -604,7 +604,7 @@ describe NotificationService, services: true do
...
@@ -604,7 +604,7 @@ describe NotificationService, services: true do
label_2
.
toggle_subscription
(
guest
)
label_2
.
toggle_subscription
(
guest
)
label_2
.
toggle_subscription
(
admin
)
label_2
.
toggle_subscription
(
admin
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
notification
.
relabeled_issue
(
confidential_issue
,
[
label_2
],
@u_disabled
)
notification
.
relabeled_issue
(
confidential_issue
,
[
label_2
],
@u_disabled
)
...
@@ -733,7 +733,7 @@ describe NotificationService, services: true do
...
@@ -733,7 +733,7 @@ describe NotificationService, services: true do
add_users_with_subscription
(
merge_request
.
target_project
,
merge_request
)
add_users_with_subscription
(
merge_request
.
target_project
,
merge_request
)
update_custom_notification
(
:new_merge_request
,
@u_guest_custom
,
project
)
update_custom_notification
(
:new_merge_request
,
@u_guest_custom
,
project
)
update_custom_notification
(
:new_merge_request
,
@u_custom_global
)
update_custom_notification
(
:new_merge_request
,
@u_custom_global
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
end
describe
'#new_merge_request'
do
describe
'#new_merge_request'
do
...
@@ -1111,7 +1111,7 @@ describe NotificationService, services: true do
...
@@ -1111,7 +1111,7 @@ describe NotificationService, services: true do
before
do
before
do
build_team
(
project
)
build_team
(
project
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
end
describe
'#project_was_moved'
do
describe
'#project_was_moved'
do
...
...
spec/workers/build_email_worker_spec.rb
View file @
230bae9d
...
@@ -24,7 +24,7 @@ describe BuildEmailWorker do
...
@@ -24,7 +24,7 @@ describe BuildEmailWorker do
end
end
it
"gracefully handles an input SMTP error"
do
it
"gracefully handles an input SMTP error"
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
allow
(
Notify
).
to
receive
(
:build_success_email
).
and_raise
(
Net
::
SMTPFatalError
)
allow
(
Notify
).
to
receive
(
:build_success_email
).
and_raise
(
Net
::
SMTPFatalError
)
subject
.
perform
(
build
.
id
,
[
user
.
email
],
data
.
stringify_keys
)
subject
.
perform
(
build
.
id
,
[
user
.
email
],
data
.
stringify_keys
)
...
...
spec/workers/emails_on_push_worker_spec.rb
View file @
230bae9d
...
@@ -87,7 +87,7 @@ describe EmailsOnPushWorker do
...
@@ -87,7 +87,7 @@ describe EmailsOnPushWorker do
context
"when there is an SMTP error"
do
context
"when there is an SMTP error"
do
before
do
before
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
allow
(
Notify
).
to
receive
(
:repository_push_email
).
and_raise
(
Net
::
SMTPFatalError
)
allow
(
Notify
).
to
receive
(
:repository_push_email
).
and_raise
(
Net
::
SMTPFatalError
)
allow
(
subject
).
to
receive_message_chain
(
:logger
,
:info
)
allow
(
subject
).
to
receive_message_chain
(
:logger
,
:info
)
perform
perform
...
@@ -112,7 +112,7 @@ describe EmailsOnPushWorker do
...
@@ -112,7 +112,7 @@ describe EmailsOnPushWorker do
original
.
call
(
Mail
.
new
(
mail
.
encoded
))
original
.
call
(
Mail
.
new
(
mail
.
encoded
))
end
end
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
end
it
"sends the mail to each of the recipients"
do
it
"sends the mail to each of the recipients"
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