Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
70fb26a6
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 搜索 >>
提交
70fb26a6
编写于
2月 03, 2014
作者:
M
Marin Jankovski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extract projects and mr into methods in features.
上级
75cecf36
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
45 addition
and
51 deletion
+45
-51
features/public/public_projects.feature
features/public/public_projects.feature
+3
-0
features/steps/public/projects_feature.rb
features/steps/public/projects_feature.rb
+42
-51
未找到文件。
features/public/public_projects.feature
浏览文件 @
70fb26a6
...
...
@@ -84,15 +84,18 @@ Feature: Public Projects Feature
Given
I sign in as a user
Given
I visit project
"Community"
page
And
I visit
"Community"
merge requests page
And
project
"Community"
has
"Bug fix"
open merge request
Then
I should see list of merge requests for
"Community"
project
Scenario
:
I
visit public project merge requests page as a non authorized user
Given
I visit project
"Community"
page
And
I visit
"Community"
merge requests page
And
project
"Community"
has
"Bug fix"
open merge request
Then
I should see list of merge requests for
"Community"
project
Scenario
:
I
visit internal project merge requests page as an authorized user
Given
I sign in as a user
Given
I visit project
"Internal"
page
And
I visit
"Internal"
merge requests page
And
project
"Internal"
has
"Feature implemented"
open merge request
Then
I should see list of merge requests for
"Internal"
project
features/steps/public/projects_feature.rb
浏览文件 @
70fb26a6
...
...
@@ -109,101 +109,92 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
end
step
'I visit "Community" issues page'
do
project
=
Project
.
find_by
(
name:
'Community'
)
create
(
:issue
,
title:
"Bug"
,
project:
project
project:
p
ublic_p
roject
)
create
(
:issue
,
title:
"New feature"
,
project:
project
project:
p
ublic_p
roject
)
visit
project_issues_path
(
project
)
visit
project_issues_path
(
p
ublic_p
roject
)
end
step
'I should see list of issues for "Community" project'
do
project
=
Project
.
find_by
(
name:
'Community'
)
page
.
should
have_content
"Bug"
page
.
should
have_content
project
.
name
page
.
should
have_content
p
ublic_p
roject
.
name
page
.
should
have_content
"New feature"
end
step
'I visit "Internal" issues page'
do
project
=
Project
.
find_by
(
name:
'Internal'
)
create
(
:issue
,
title:
"Internal Bug"
,
project:
project
project:
internal_
project
)
create
(
:issue
,
title:
"New internal feature"
,
project:
project
project:
internal_
project
)
visit
project_issues_path
(
project
)
visit
project_issues_path
(
internal_
project
)
end
step
'I should see list of issues for "Internal" project'
do
project
=
Project
.
find_by
(
name:
'Internal'
)
page
.
should
have_content
"Internal Bug"
page
.
should
have_content
project
.
name
page
.
should
have_content
internal_
project
.
name
page
.
should
have_content
"New internal feature"
end
step
'I visit "Community" merge requests page'
do
project
=
Project
.
find_by
(
name:
'Community'
)
create
(
:merge_request
,
title:
"Bug fix"
,
source_project:
project
,
target_project:
project
,
source_branch:
'stable'
,
target_branch:
'master'
,
)
visit
project_merge_requests_path
(
public_project
)
end
step
'project "Community" has "Bug fix" open merge request'
do
create
(
:merge_request
,
title:
"Feature created"
,
source_project:
project
,
target_project:
project
,
source_branch:
'stable'
,
target_branch:
'master'
,
title:
"Bug fix for public project"
,
source_project:
public_project
,
target_project:
public_project
,
)
visit
project_merge_requests_path
(
project
)
end
step
'I should see list of merge requests for "Community" project'
do
project
=
Project
.
find_by
(
name:
'Community'
)
page
.
should
have_content
"Bug fix"
page
.
should
have_content
project
.
name
page
.
should
have_content
"Feature created"
page
.
should
have_content
public_project
.
name
page
.
should
have_content
public_merge_request
.
source_project
.
name
end
step
'I visit "Internal" merge requests page'
do
project
=
Project
.
find_by
(
name:
'Internal'
)
create
(
:merge_request
,
title:
"Bug fix internal"
,
source_project:
project
,
target_project:
project
,
source_branch:
'stable'
,
target_branch:
'master'
,
)
visit
project_merge_requests_path
(
internal_project
)
end
step
'project "Internal" has "Feature implemented" open merge request'
do
create
(
:merge_request
,
title:
"Feature created for internal"
,
source_project:
project
,
target_project:
project
,
source_branch:
'stable'
,
target_branch:
'master'
,
title:
"Feature implemented"
,
source_project:
internal_project
,
target_project:
internal_project
)
visit
project_merge_requests_path
(
project
)
end
step
'I should see list of merge requests for "Internal" project'
do
project
=
Project
.
find_by
(
name:
'Internal'
)
page
.
should
have_content
internal_project
.
name
page
.
should
have_content
internal_merge_request
.
source_project
.
name
end
def
internal_project
@internal_project
||=
Project
.
find_by!
(
name:
'Internal'
)
end
def
public_project
@public_project
||=
Project
.
find_by!
(
name:
'Community'
)
end
def
internal_merge_request
@internal_merge_request
||=
MergeRequest
.
find_by!
(
title:
'Feature implemented'
)
end
page
.
should
have_content
"Bug fix internal"
page
.
should
have_content
project
.
name
page
.
should
have_content
"Feature created for internal"
def
public_merge_request
@public_merge_request
||=
MergeRequest
.
find_by!
(
title:
'Bug fix for public project'
)
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录