Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
996d146c
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
996d146c
编写于
9月 13, 2013
作者:
J
Jakub Zienkiewicz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test if commit author receives new note notifications
上级
5ff79f94
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
12 deletion
+12
-12
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+12
-12
未找到文件。
spec/services/notification_service_spec.rb
浏览文件 @
996d146c
...
@@ -52,10 +52,12 @@ describe NotificationService do
...
@@ -52,10 +52,12 @@ describe NotificationService do
before
do
before
do
build_team
(
note
.
project
)
build_team
(
note
.
project
)
note
.
stub
(
:commit_author
=>
@u_committer
)
end
end
describe
:new_note
do
describe
:new_note
do
it
do
it
do
should_email
(
@u_committer
.
id
,
note
)
should_email
(
@u_watcher
.
id
,
note
)
should_email
(
@u_watcher
.
id
,
note
)
should_not_email
(
@u_mentioned
.
id
,
note
)
should_not_email
(
@u_mentioned
.
id
,
note
)
should_not_email
(
note
.
author_id
,
note
)
should_not_email
(
note
.
author_id
,
note
)
...
@@ -65,18 +67,14 @@ describe NotificationService do
...
@@ -65,18 +67,14 @@ describe NotificationService do
end
end
it
do
it
do
new_note
=
create
(
:note_on_commit
,
note
.
update_attribute
(
:note
,
'@mention referenced'
)
author:
@u_participating
,
should_email
(
@u_committer
.
id
,
note
)
project_id:
note
.
project_id
,
should_email
(
@u_watcher
.
id
,
note
)
commit_id:
note
.
commit_id
,
should_email
(
@u_mentioned
.
id
,
note
)
note:
'@mention referenced'
)
should_not_email
(
note
.
author_id
,
note
)
should_not_email
(
@u_participating
.
id
,
note
)
should_email
(
@u_watcher
.
id
,
new_note
)
should_not_email
(
@u_disabled
.
id
,
note
)
should_email
(
@u_mentioned
.
id
,
new_note
)
notification
.
new_note
(
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
)
end
end
def
should_email
(
user_id
,
n
)
def
should_email
(
user_id
,
n
)
...
@@ -240,10 +238,12 @@ describe NotificationService do
...
@@ -240,10 +238,12 @@ describe NotificationService do
@u_participating
=
create
(
:user
,
notification_level:
Notification
::
N_PARTICIPATING
)
@u_participating
=
create
(
:user
,
notification_level:
Notification
::
N_PARTICIPATING
)
@u_disabled
=
create
(
:user
,
notification_level:
Notification
::
N_DISABLED
)
@u_disabled
=
create
(
:user
,
notification_level:
Notification
::
N_DISABLED
)
@u_mentioned
=
create
(
:user
,
username:
'mention'
,
notification_level:
Notification
::
N_PARTICIPATING
)
@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_watcher
,
:master
]
project
.
team
<<
[
@u_participating
,
:master
]
project
.
team
<<
[
@u_participating
,
:master
]
project
.
team
<<
[
@u_disabled
,
:master
]
project
.
team
<<
[
@u_disabled
,
:master
]
project
.
team
<<
[
@u_mentioned
,
:master
]
project
.
team
<<
[
@u_mentioned
,
:master
]
project
.
team
<<
[
@u_committer
,
:master
]
end
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录