Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
acfe25ed
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 搜索 >>
提交
acfe25ed
编写于
2月 17, 2016
作者:
T
Tomasz Maczukin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactorize `ci_runner` factory and `let` definitions in runners API spec
上级
e4d2f997
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
18 addition
and
22 deletion
+18
-22
spec/factories/ci/runners.rb
spec/factories/ci/runners.rb
+4
-6
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+14
-16
未找到文件。
spec/factories/ci/runners.rb
浏览文件 @
acfe25ed
...
...
@@ -26,13 +26,11 @@ FactoryGirl.define do
end
platform
"darwin"
is_shared
false
active
true
factory
:ci_shared_runner
do
trait
:shared
do
is_shared
true
end
factory
:ci_specific_runner
do
is_shared
false
end
end
end
spec/requests/api/runners_spec.rb
浏览文件 @
acfe25ed
require
'spec_helper'
describe
API
::
API
,
api:
true
do
describe
API
::
Runners
,
api:
true
do
include
ApiHelpers
let
(
:admin
)
{
create
(
:user
,
:admin
)
}
...
...
@@ -10,20 +10,20 @@ describe API::API, api: true do
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let
(
:project2
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:shared_runner
)
{
create
(
:ci_
shared_runner
,
tag_list:
[
'mysql'
,
'ruby'
],
active:
true
)
}
let!
(
:unused_specific_runner
)
{
create
(
:ci_
specific_
runner
)
}
let!
(
:shared_runner
)
{
create
(
:ci_
runner
,
:shared
)
}
let!
(
:unused_specific_runner
)
{
create
(
:ci_runner
)
}
let!
(
:specific_runner
)
do
runner
=
create
(
:ci_specific_runner
,
tag_list:
[
'mysql'
,
'ruby'
])
create
(
:ci_runner
).
tap
do
|
runner
|
create
(
:ci_runner_project
,
runner:
runner
,
project:
project
)
runner
end
end
let!
(
:two_projects_runner
)
do
runner
=
create
(
:ci_specific_runner
)
create
(
:ci_runner
).
tap
do
|
runner
|
create
(
:ci_runner_project
,
runner:
runner
,
project:
project
)
create
(
:ci_runner_project
,
runner:
runner
,
project:
project2
)
runner
end
end
before
do
...
...
@@ -352,14 +352,12 @@ describe API::API, api: true do
end
describe
'POST /projects/:id/runners'
do
let
(
:specific_runner2
)
do
runner
=
create
(
:ci_specific_runner
)
context
'authorized user'
do
it
'should enable specific runner'
do
specific_runner2
=
create
(
:ci_runner
).
tap
do
|
runner
|
create
(
:ci_runner_project
,
runner:
runner
,
project:
project2
)
runner
end
context
'authorized user'
do
it
'should enable specific runner'
do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/runners"
,
user
),
runner_id:
specific_runner2
.
id
end
.
to
change
{
project
.
runners
.
count
}.
by
(
+
1
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录