Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c195b313
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,发现更多精彩内容 >>
未验证
提交
c195b313
编写于
5月 07, 2017
作者:
K
Kamil Trzcinski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make test that actually displays pipeline graph
上级
b46d38ae
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
54 addition
and
67 deletion
+54
-67
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+54
-0
spec/views/projects/pipelines/show.html.haml_spec.rb
spec/views/projects/pipelines/show.html.haml_spec.rb
+0
-67
未找到文件。
spec/features/projects/pipelines/pipelines_spec.rb
浏览文件 @
c195b313
...
...
@@ -370,6 +370,60 @@ describe 'Pipelines', :feature, :js do
end
end
describe
'GET /:project/pipelines/show'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
user:
user
)
end
before
do
create_build
(
'build'
,
0
,
'build'
,
:success
)
create_build
(
'test'
,
1
,
'rspec 0:2'
,
:pending
)
create_build
(
'test'
,
1
,
'rspec 1:2'
,
:running
)
create_build
(
'test'
,
1
,
'spinach 0:2'
,
:created
)
create_build
(
'test'
,
1
,
'spinach 1:2'
,
:created
)
create_build
(
'test'
,
1
,
'audit'
,
:created
)
create_build
(
'deploy'
,
2
,
'production'
,
:created
)
create
(
:generic_commit_status
,
pipeline:
pipeline
,
stage:
'external'
,
name:
'jenkins'
,
stage_idx:
3
)
visit
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
wait_for_vue_resource
end
it
'shows a graph with grouped stages'
do
expect
(
page
).
to
have_css
(
'.js-pipeline-graph'
)
# expect(page).to have_css('.js-grouped-pipeline-dropdown')
# header
expect
(
page
).
to
have_text
(
"#
#{
pipeline
.
id
}
"
)
expect
(
page
).
to
have_css
(
'time'
,
text:
pipeline
.
created_at
.
strftime
(
"%b %d, %Y"
))
expect
(
page
).
to
have_selector
(
%Q(img[alt$="
#{
pipeline
.
user
.
name
}
's avatar"])
)
expect
(
page
).
to
have_link
(
pipeline
.
user
.
name
,
href:
user_path
(
pipeline
.
user
))
# stages
expect
(
page
).
to
have_text
(
'Build'
)
expect
(
page
).
to
have_text
(
'Test'
)
expect
(
page
).
to
have_text
(
'Deploy'
)
expect
(
page
).
to
have_text
(
'External'
)
# builds
expect
(
page
).
to
have_text
(
'rspec'
)
expect
(
page
).
to
have_text
(
'spinach'
)
expect
(
page
).
to
have_text
(
'rspec 0:2'
)
expect
(
page
).
to
have_text
(
'production'
)
expect
(
page
).
to
have_text
(
'jenkins'
)
end
def
create_build
(
stage
,
stage_idx
,
name
,
status
)
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
stage
,
stage_idx:
stage_idx
,
name:
name
,
status:
status
)
end
end
describe
'POST /:project/pipelines'
do
let
(
:project
)
{
create
(
:project
)
}
...
...
spec/views/projects/pipelines/show.html.haml_spec.rb
已删除
100644 → 0
浏览文件 @
b46d38ae
require
'spec_helper'
describe
'projects/pipelines/show'
do
include
Devise
::
Test
::
ControllerHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
user:
user
)
end
before
do
controller
.
prepend_view_path
(
'app/views/projects'
)
create_build
(
'build'
,
0
,
'build'
,
:success
)
create_build
(
'test'
,
1
,
'rspec 0:2'
,
:pending
)
create_build
(
'test'
,
1
,
'rspec 1:2'
,
:running
)
create_build
(
'test'
,
1
,
'spinach 0:2'
,
:created
)
create_build
(
'test'
,
1
,
'spinach 1:2'
,
:created
)
create_build
(
'test'
,
1
,
'audit'
,
:created
)
create_build
(
'deploy'
,
2
,
'production'
,
:created
)
create
(
:generic_commit_status
,
pipeline:
pipeline
,
stage:
'external'
,
name:
'jenkins'
,
stage_idx:
3
)
assign
(
:project
,
project
)
assign
(
:pipeline
,
pipeline
.
present
(
current_user:
user
))
assign
(
:commit
,
project
.
commit
)
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
end
it
'shows a graph with grouped stages'
do
render
expect
(
rendered
).
to
have_css
(
'.js-pipeline-graph'
)
expect
(
rendered
).
to
have_css
(
'.js-grouped-pipeline-dropdown'
)
# header
expect
(
rendered
).
to
have_text
(
"#
#{
pipeline
.
id
}
"
)
expect
(
rendered
).
to
have_css
(
'time'
,
text:
pipeline
.
created_at
.
strftime
(
"%b %d, %Y"
))
expect
(
rendered
).
to
have_selector
(
%Q(img[alt$="
#{
pipeline
.
user
.
name
}
's avatar"])
)
expect
(
rendered
).
to
have_link
(
pipeline
.
user
.
name
,
href:
user_path
(
pipeline
.
user
))
# stages
expect
(
rendered
).
to
have_text
(
'Build'
)
expect
(
rendered
).
to
have_text
(
'Test'
)
expect
(
rendered
).
to
have_text
(
'Deploy'
)
expect
(
rendered
).
to
have_text
(
'External'
)
# builds
expect
(
rendered
).
to
have_text
(
'rspec'
)
expect
(
rendered
).
to
have_text
(
'spinach'
)
expect
(
rendered
).
to
have_text
(
'rspec 0:2'
)
expect
(
rendered
).
to
have_text
(
'production'
)
expect
(
rendered
).
to
have_text
(
'jenkins'
)
end
private
def
create_build
(
stage
,
stage_idx
,
name
,
status
)
create
(
:ci_build
,
pipeline:
pipeline
,
stage:
stage
,
stage_idx:
stage_idx
,
name:
name
,
status:
status
)
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录