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
Léo-Paul Géneau
gitlab-ce
Commits
996d146c
Commit
996d146c
authored
Sep 13, 2013
by
Jakub Zienkiewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test if commit author receives new note notifications
parent
5ff79f94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+12
-12
No files found.
spec/services/notification_service_spec.rb
View file @
996d146c
...
...
@@ -52,10 +52,12 @@ describe NotificationService do
before
do
build_team
(
note
.
project
)
note
.
stub
(
:commit_author
=>
@u_committer
)
end
describe
:new_note
do
it
do
should_email
(
@u_committer
.
id
,
note
)
should_email
(
@u_watcher
.
id
,
note
)
should_not_email
(
@u_mentioned
.
id
,
note
)
should_not_email
(
note
.
author_id
,
note
)
...
...
@@ -65,18 +67,14 @@ describe NotificationService do
end
it
do
new_note
=
create
(
:note_on_commit
,
author:
@u_participating
,
project_id:
note
.
project_id
,
commit_id:
note
.
commit_id
,
note:
'@mention referenced'
)
should_email
(
@u_watcher
.
id
,
new_note
)
should_email
(
@u_mentioned
.
id
,
new_note
)
should_not_email
(
new_note
.
author_id
,
new_note
)
should_not_email
(
@u_participating
.
id
,
new_note
)
should_not_email
(
@u_disabled
.
id
,
new_note
)
notification
.
new_note
(
new_note
)
note
.
update_attribute
(
:note
,
'@mention referenced'
)
should_email
(
@u_committer
.
id
,
note
)
should_email
(
@u_watcher
.
id
,
note
)
should_email
(
@u_mentioned
.
id
,
note
)
should_not_email
(
note
.
author_id
,
note
)
should_not_email
(
@u_participating
.
id
,
note
)
should_not_email
(
@u_disabled
.
id
,
note
)
notification
.
new_note
(
note
)
end
def
should_email
(
user_id
,
n
)
...
...
@@ -240,10 +238,12 @@ describe NotificationService do
@u_participating
=
create
(
:user
,
notification_level:
Notification
::
N_PARTICIPATING
)
@u_disabled
=
create
(
:user
,
notification_level:
Notification
::
N_DISABLED
)
@u_mentioned
=
create
(
:user
,
username:
'mention'
,
notification_level:
Notification
::
N_PARTICIPATING
)
@u_committer
=
create
(
:user
,
username:
'committer'
)
project
.
team
<<
[
@u_watcher
,
:master
]
project
.
team
<<
[
@u_participating
,
:master
]
project
.
team
<<
[
@u_disabled
,
:master
]
project
.
team
<<
[
@u_mentioned
,
:master
]
project
.
team
<<
[
@u_committer
,
:master
]
end
end
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