Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
cf0eab50
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 搜索 >>
提交
cf0eab50
编写于
2月 08, 2016
作者:
G
Grzegorz Bizon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add feature tests for builds status badge
上级
eb7721e1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
2 deletion
+52
-2
features/project/builds/badge.feature
features/project/builds/badge.feature
+17
-0
features/steps/project/builds/badge.rb
features/steps/project/builds/badge.rb
+25
-0
features/steps/shared/builds.rb
features/steps/shared/builds.rb
+10
-2
未找到文件。
features/project/builds/badge.feature
0 → 100644
浏览文件 @
cf0eab50
Feature
:
Project Builds Badge
Background
:
Given
project exists in some group namespace
And
project has CI enabled
And
project has a recent build
Scenario
:
I
want to see a badge for successfully built project
Given
recent build is successfull
When
I display builds badge for a master branch
Then
I should see a build success badge
And
build badge is a svg image
Scenario
:
I
want to see a badge for project with filed builds
Given
recent build failed
When
I display builds badge for a master branch
Then
I should see a build failed badge
And
build badge is a svg image
features/steps/project/builds/badge.rb
0 → 100644
浏览文件 @
cf0eab50
class
Spinach::Features::ProjectBuildsBadge
<
Spinach
::
FeatureSteps
include
SharedProject
include
SharedBuilds
include
RepoHelpers
step
'I display builds badge for a master branch'
do
visit
badge_namespace_project_builds_path
(
@project
.
namespace
,
@project
,
ref: :master
,
format: :svg
)
end
step
'I should see a build success badge'
do
expect
(
svg
.
at
(
'text:contains("success")'
)).
to
be_truthy
end
step
'I should see a build failed badge'
do
expect
(
svg
.
at
(
'text:contains("failed")'
)).
to
be_truthy
end
step
'build badge is a svg image'
do
expect
(
page
.
response_headers
).
to
include
(
'Content-Type'
=>
'image/svg+xml'
)
end
def
svg
Nokogiri
::
HTML
.
parse
(
page
.
body
)
end
end
features/steps/shared/builds.rb
浏览文件 @
cf0eab50
...
...
@@ -6,8 +6,16 @@ module SharedBuilds
end
step
'project has a recent build'
do
ci_commit
=
create
:ci_commit
,
project:
@project
,
sha:
sample_commit
.
id
@build
=
create
:ci_build
,
commit:
ci_commit
@ci_commit
=
create
(
:ci_commit
,
project:
@project
,
sha:
@project
.
commit
.
sha
)
@build
=
create
(
:ci_build
,
commit:
@ci_commit
)
end
step
'recent build is successfull'
do
@build
.
update_column
(
:status
,
'success'
)
end
step
'recent build failed'
do
@build
.
update_column
(
:status
,
'failed'
)
end
step
'I visit recent build details page'
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录