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
df3fe91a
Commit
df3fe91a
authored
Jan 22, 2019
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor notification spec
DRY maintainer
parent
18183f8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
ee/spec/services/ee/notification_service_spec.rb
ee/spec/services/ee/notification_service_spec.rb
+7
-15
No files found.
ee/spec/services/ee/notification_service_spec.rb
View file @
df3fe91a
...
@@ -510,7 +510,7 @@ describe EE::NotificationService, :mailer do
...
@@ -510,7 +510,7 @@ describe EE::NotificationService, :mailer do
issuable
.
subscriptions
.
create
(
user:
@watcher_and_subscriber
,
subscribed:
true
)
issuable
.
subscriptions
.
create
(
user:
@watcher_and_subscriber
,
subscribed:
true
)
end
end
describe
'Merge Requests'
do
context
'Merge Requests'
do
let
(
:notification
)
{
NotificationService
.
new
}
let
(
:notification
)
{
NotificationService
.
new
}
let
(
:assignee
)
{
create
(
:user
)
}
let
(
:assignee
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
...
@@ -599,15 +599,9 @@ describe EE::NotificationService, :mailer do
...
@@ -599,15 +599,9 @@ describe EE::NotificationService, :mailer do
@u_guest_watcher
=
create_user_with_notification
(
:watch
,
'guest_watching'
)
@u_guest_watcher
=
create_user_with_notification
(
:watch
,
'guest_watching'
)
@u_guest_custom
=
create_user_with_notification
(
:custom
,
'guest_custom'
)
@u_guest_custom
=
create_user_with_notification
(
:custom
,
'guest_custom'
)
project
.
add_maintainer
(
@u_watcher
)
[
@u_watcher
,
@u_participating
,
@u_participant_mentioned
,
@u_disabled
,
@u_mentioned
,
@u_committer
,
@u_not_mentioned
,
@u_lazy_participant
,
@u_custom_global
].
each
do
|
user
|
project
.
add_maintainer
(
@u_participating
)
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
@u_participant_mentioned
)
end
project
.
add_maintainer
(
@u_disabled
)
project
.
add_maintainer
(
@u_mentioned
)
project
.
add_maintainer
(
@u_committer
)
project
.
add_maintainer
(
@u_not_mentioned
)
project
.
add_maintainer
(
@u_lazy_participant
)
project
.
add_maintainer
(
@u_custom_global
)
end
end
def
add_users_with_subscription
(
project
,
issuable
)
def
add_users_with_subscription
(
project
,
issuable
)
...
@@ -617,11 +611,9 @@ describe EE::NotificationService, :mailer do
...
@@ -617,11 +611,9 @@ describe EE::NotificationService, :mailer do
@subscribed_participant
=
create_global_setting_for
(
create
(
:user
,
username:
'subscribed_participant'
),
:participating
)
@subscribed_participant
=
create_global_setting_for
(
create
(
:user
,
username:
'subscribed_participant'
),
:participating
)
@watcher_and_subscriber
=
create_global_setting_for
(
create
(
:user
),
:watch
)
@watcher_and_subscriber
=
create_global_setting_for
(
create
(
:user
),
:watch
)
project
.
add_maintainer
(
@subscribed_participant
)
[
@subscribed_participant
,
@subscriber
,
@unsubscriber
,
@watcher_and_subscriber
,
@unsubscribed_mentioned
].
each
do
|
user
|
project
.
add_maintainer
(
@subscriber
)
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
@unsubscriber
)
end
project
.
add_maintainer
(
@watcher_and_subscriber
)
project
.
add_maintainer
(
@unsubscribed_mentioned
)
issuable
.
subscriptions
.
create
(
user:
@unsubscribed_mentioned
,
project:
project
,
subscribed:
false
)
issuable
.
subscriptions
.
create
(
user:
@unsubscribed_mentioned
,
project:
project
,
subscribed:
false
)
issuable
.
subscriptions
.
create
(
user:
@subscriber
,
project:
project
,
subscribed:
true
)
issuable
.
subscriptions
.
create
(
user:
@subscriber
,
project:
project
,
subscribed:
true
)
...
...
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