Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
8ec8aa14
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,发现更多精彩内容 >>
提交
8ec8aa14
编写于
3月 27, 2017
作者:
R
Robert Speicher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use `:empty_project` where possible in mailer specs
上级
d4c99f64
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
6 deletion
+11
-6
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+10
-5
spec/support/notify_shared_examples.rb
spec/support/notify_shared_examples.rb
+1
-1
未找到文件。
spec/mailers/notify_spec.rb
浏览文件 @
8ec8aa14
...
...
@@ -184,6 +184,7 @@ describe Notify do
end
context
'for merge requests'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_author
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
author:
current_user
,
assignee:
assignee
,
source_project:
project
,
target_project:
project
)
}
let
(
:merge_request_with_description
)
{
create
(
:merge_request
,
author:
current_user
,
assignee:
assignee
,
source_project:
project
,
target_project:
project
,
description:
FFaker
::
Lorem
.
sentence
)
}
...
...
@@ -334,7 +335,7 @@ describe Notify do
end
describe
'project was moved'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
,
"gitlab/gitlab"
)
}
...
...
@@ -460,7 +461,7 @@ describe Notify do
end
describe
'project invitation'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:master
)
{
create
(
:user
).
tap
{
|
u
|
project
.
team
<<
[
u
,
:master
]
}
}
let
(
:project_member
)
{
invite_to_project
(
project
,
inviter:
master
)
}
...
...
@@ -480,7 +481,7 @@ describe Notify do
end
describe
'project invitation accepted'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:invited_user
)
{
create
(
:user
,
name:
'invited user'
)
}
let
(
:master
)
{
create
(
:user
).
tap
{
|
u
|
project
.
team
<<
[
u
,
:master
]
}
}
let
(
:project_member
)
do
...
...
@@ -505,7 +506,7 @@ describe Notify do
end
describe
'project invitation declined'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:master
)
{
create
(
:user
).
tap
{
|
u
|
project
.
team
<<
[
u
,
:master
]
}
}
let
(
:project_member
)
do
invitee
=
invite_to_project
(
project
,
inviter:
master
)
...
...
@@ -569,6 +570,7 @@ describe Notify do
end
describe
'on a commit'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:commit
)
{
project
.
commit
}
before
(
:each
)
{
allow
(
note
).
to
receive
(
:noteable
).
and_return
(
commit
)
}
...
...
@@ -636,6 +638,7 @@ describe Notify do
end
context
'items that are noteable, emails for a note on a diff'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:note_author
)
{
create
(
:user
,
name:
'author_name'
)
}
before
:each
do
...
...
@@ -977,6 +980,7 @@ describe Notify do
end
describe
'email on push with multiple commits'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:example_site_path
)
{
root_path
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:raw_compare
)
{
Gitlab
::
Git
::
Compare
.
new
(
project
.
repository
.
raw_repository
,
sample_image_commit
.
id
,
sample_commit
.
id
)
}
...
...
@@ -1070,6 +1074,7 @@ describe Notify do
end
describe
'email on push with a single commit'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:example_site_path
)
{
root_path
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:raw_compare
)
{
Gitlab
::
Git
::
Compare
.
new
(
project
.
repository
.
raw_repository
,
sample_commit
.
parent_id
,
sample_commit
.
id
)
}
...
...
@@ -1102,7 +1107,7 @@ describe Notify do
end
describe
'HTML emails setting'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:multipart_mail
)
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
,
"gitlab/gitlab"
)
}
...
...
spec/support/notify_shared_examples.rb
浏览文件 @
8ec8aa14
...
...
@@ -3,7 +3,7 @@ shared_context 'gitlab email notification' do
let
(
:gitlab_sender
)
{
Gitlab
.
config
.
gitlab
.
email_from
}
let
(
:gitlab_sender_reply_to
)
{
Gitlab
.
config
.
gitlab
.
email_reply_to
}
let
(
:recipient
)
{
create
(
:user
,
email:
'recipient@example.com'
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:new_user_address
)
{
'newguy@example.com'
}
before
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录