BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
notify.rb
spec/mailers/shared/notify.rb
+1
-1
pipeline_email_service_spec.rb
spec/models/project_services/pipeline_email_service_spec.rb
+1
-1
notification_service_spec.rb
spec/services/notification_service_spec.rb
+14
-14
build_email_worker_spec.rb
spec/workers/build_email_worker_spec.rb
+1
-1
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
let
(
:new_user_address
)
{
'newguy@example.com'
}
before
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
email
=
recipient
.
emails
.
create
(
email:
"notifications@example.com"
)
recipient
.
update_attribute
(
:notification_email
,
email
.
email
)
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
end
before
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
describe
'Validations'
do
...
...
spec/services/notification_service_spec.rb
View file @
230bae9d
...
...
@@ -17,7 +17,7 @@ describe NotificationService, services: true do
it
'sends no emails when no new mentions are present'
do
send_notifications
expect
(
ActionMailer
::
Base
.
deliveries
).
to
be_empty
should_email_no_one
end
it
'emails new mentions with a watch level higher than participant'
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
send_notifications
(
@u_participating
,
@u_mentioned
)
expect
(
ActionMailer
::
Base
.
deliveries
).
to
be_empty
should_email_no_one
end
end
...
...
@@ -79,7 +79,7 @@ describe NotificationService, services: true do
# Ensure create SentNotification by noteable = issue 6 times, not noteable = note
expect
(
SentNotification
).
to
receive
(
:record
).
with
(
issue
,
any_args
).
exactly
(
8
).
times
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
notification
.
new_note
(
note
)
...
...
@@ -111,7 +111,7 @@ describe NotificationService, services: true do
context
'participating'
do
context
'by note'
do
before
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
note
.
author
=
@u_lazy_participant
note
.
save
notification
.
new_note
(
note
)
...
...
@@ -134,7 +134,7 @@ describe NotificationService, services: true do
@u_watcher
.
notification_settings_for
(
note
.
project
).
participating!
@u_watcher
.
notification_settings_for
(
note
.
project
.
group
).
global!
update_custom_notification
(
:new_note
,
@u_custom_global
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
it
do
...
...
@@ -173,7 +173,7 @@ describe NotificationService, services: true do
expect
(
SentNotification
).
to
receive
(
:record
).
with
(
confidential_issue
,
any_args
).
exactly
(
4
).
times
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
notification
.
new_note
(
note
)
...
...
@@ -196,7 +196,7 @@ describe NotificationService, services: true do
before
do
build_team
(
note
.
project
)
note
.
project
.
team
<<
[
note
.
author
,
:master
]
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
describe
'#new_note'
do
...
...
@@ -238,7 +238,7 @@ describe NotificationService, services: true do
before
do
build_team
(
note
.
project
)
note
.
project
.
team
<<
[
note
.
author
,
:master
]
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
describe
'#new_note'
do
...
...
@@ -273,7 +273,7 @@ describe NotificationService, services: true do
before
do
build_team
(
note
.
project
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
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_custom_global
)
...
...
@@ -348,7 +348,7 @@ describe NotificationService, services: true do
before
do
build_team
(
issue
.
project
)
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_custom_global
)
end
...
...
@@ -408,7 +408,7 @@ describe NotificationService, services: true do
label
.
toggle_subscription
(
guest
)
label
.
toggle_subscription
(
admin
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
notification
.
new_issue
(
confidential_issue
,
@u_disabled
)
...
...
@@ -604,7 +604,7 @@ describe NotificationService, services: true do
label_2
.
toggle_subscription
(
guest
)
label_2
.
toggle_subscription
(
admin
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
notification
.
relabeled_issue
(
confidential_issue
,
[
label_2
],
@u_disabled
)
...
...
@@ -733,7 +733,7 @@ describe NotificationService, services: true do
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_custom_global
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
describe
'#new_merge_request'
do
...
...
@@ -1111,7 +1111,7 @@ describe NotificationService, services: true do
before
do
build_team
(
project
)
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
describe
'#project_was_moved'
do
...
...
spec/workers/build_email_worker_spec.rb
View file @
230bae9d
...
...
@@ -24,7 +24,7 @@ describe BuildEmailWorker do
end
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
)
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
context
"when there is an SMTP error"
do
before
do
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
allow
(
Notify
).
to
receive
(
:repository_push_email
).
and_raise
(
Net
::
SMTPFatalError
)
allow
(
subject
).
to
receive_message_chain
(
:logger
,
:info
)
perform
...
...
@@ -112,7 +112,7 @@ describe EmailsOnPushWorker do
original
.
call
(
Mail
.
new
(
mail
.
encoded
))
end
ActionMailer
::
Base
.
deliveries
.
clear
reset_delivered_emails!
end
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