Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
1f3f0666
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,体验更适合开发者的 AI 搜索 >>
提交
1f3f0666
编写于
10月 10, 2018
作者:
S
Shinya Maeda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix and add spec
上级
4f49f54a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
67 addition
and
2 deletion
+67
-2
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+44
-2
spec/models/deployment_spec.rb
spec/models/deployment_spec.rb
+1
-0
spec/serializers/deployment_entity_spec.rb
spec/serializers/deployment_entity_spec.rb
+22
-0
未找到文件。
spec/models/ci/build_spec.rb
浏览文件 @
1f3f0666
...
...
@@ -1523,11 +1523,11 @@ describe Ci::Build do
end
end
describe
'#other_actions'
do
describe
'#other_
manual_
actions'
do
let
(
:build
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
)
}
let!
(
:other_build
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'other action'
)
}
subject
{
build
.
other_actions
}
subject
{
build
.
other_
manual_
actions
}
before
do
project
.
add_developer
(
user
)
...
...
@@ -1558,6 +1558,48 @@ describe Ci::Build do
end
end
describe
'#other_scheduled_actions'
do
let
(
:build
)
{
create
(
:ci_build
,
:scheduled
,
pipeline:
pipeline
)
}
subject
{
build
.
other_scheduled_actions
}
before
do
project
.
add_developer
(
user
)
end
context
"when other build's status is success"
do
let!
(
:other_build
)
{
create
(
:ci_build
,
:schedulable
,
:success
,
pipeline:
pipeline
,
name:
'other action'
)
}
it
'returns other actions'
do
is_expected
.
to
contain_exactly
(
other_build
)
end
end
context
"when other build's status is failed"
do
let!
(
:other_build
)
{
create
(
:ci_build
,
:schedulable
,
:failed
,
pipeline:
pipeline
,
name:
'other action'
)
}
it
'returns other actions'
do
is_expected
.
to
contain_exactly
(
other_build
)
end
end
context
"when other build's status is running"
do
let!
(
:other_build
)
{
create
(
:ci_build
,
:schedulable
,
:running
,
pipeline:
pipeline
,
name:
'other action'
)
}
it
'does not return other actions'
do
is_expected
.
to
be_empty
end
end
context
"when other build's status is scheduled"
do
let!
(
:other_build
)
{
create
(
:ci_build
,
:scheduled
,
pipeline:
pipeline
,
name:
'other action'
)
}
it
'does not return other actions'
do
is_expected
.
to
contain_exactly
(
other_build
)
end
end
end
describe
'#persisted_environment'
do
let!
(
:environment
)
do
create
(
:environment
,
project:
project
,
name:
"foo-
#{
project
.
default_branch
}
"
)
...
...
spec/models/deployment_spec.rb
浏览文件 @
1f3f0666
...
...
@@ -12,6 +12,7 @@ describe Deployment do
it
{
is_expected
.
to
delegate_method
(
:commit
).
to
(
:project
)
}
it
{
is_expected
.
to
delegate_method
(
:commit_title
).
to
(
:commit
).
as
(
:try
)
}
it
{
is_expected
.
to
delegate_method
(
:manual_actions
).
to
(
:deployable
).
as
(
:try
)
}
it
{
is_expected
.
to
delegate_method
(
:scheduled_actions
).
to
(
:deployable
).
as
(
:try
)
}
it
{
is_expected
.
to
validate_presence_of
(
:ref
)
}
it
{
is_expected
.
to
validate_presence_of
(
:sha
)
}
...
...
spec/serializers/deployment_entity_spec.rb
浏览文件 @
1f3f0666
...
...
@@ -22,4 +22,26 @@ describe DeploymentEntity do
it
'exposes creation date'
do
expect
(
subject
).
to
include
(
:created_at
)
end
describe
'scheduled_actions'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
user:
user
)
}
let
(
:build
)
{
create
(
:ci_build
,
:success
,
pipeline:
pipeline
)
}
let
(
:deployment
)
{
create
(
:deployment
,
deployable:
build
)
}
context
'when deployment has another action'
do
let
(
:other_build
)
{
create
(
:ci_build
,
:scheduled
,
pipeline:
pipeline
,
name:
'other build'
)
}
let!
(
:other_deployment
)
{
create
(
:deployment
,
deployable:
other_build
)
}
it
'returns other actions'
do
expect
(
subject
[
:scheduled_actions
][
0
][
:name
]).
to
eq
'other build'
end
end
context
'when deployment does not have other actions'
do
it
'does not return other actions'
do
expect
(
subject
[
:scheduled_actions
]).
to
be_empty
end
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录