Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c7f74256
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 搜索 >>
提交
c7f74256
编写于
9月 07, 2016
作者:
B
Bryce Johnson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simulate filtering with url params, clean up accordingly.
上级
a329763d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
44 deletion
+7
-44
spec/features/issues/reset_filters_spec.rb
spec/features/issues/reset_filters_spec.rb
+7
-44
未找到文件。
spec/features/issues/reset_filters_spec.rb
浏览文件 @
c7f74256
...
@@ -2,6 +2,7 @@ require 'rails_helper'
...
@@ -2,6 +2,7 @@ require 'rails_helper'
feature
'Issues filter reset button'
,
feature:
true
,
js:
true
do
feature
'Issues filter reset button'
,
feature:
true
,
js:
true
do
include
WaitForAjax
include
WaitForAjax
include
IssueHelpers
let!
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:project
)
{
create
(
:project
,
:public
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)}
...
@@ -12,12 +13,11 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -12,12 +13,11 @@ feature 'Issues filter reset button', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
user
,
:developer
]
project
.
team
<<
[
user
,
:developer
]
visit_issues
(
project
)
end
end
context
'when a milestone filter has been applied'
do
context
'when a milestone filter has been applied'
do
it
'resets the milestone filter'
do
it
'resets the milestone filter'
do
filter_by_milestone
(
milestone
.
title
)
visit_issues
(
project
,
milestone_title:
milestone
.
title
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -27,7 +27,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -27,7 +27,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when a label filter has been applied'
do
context
'when a label filter has been applied'
do
it
'resets the label filter'
do
it
'resets the label filter'
do
filter_by_label
(
bug
.
titl
e
)
visit_issues
(
project
,
label_name:
bug
.
nam
e
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -37,8 +37,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -37,8 +37,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when a text search has been conducted'
do
context
'when a text search has been conducted'
do
it
'resets the text search filter'
do
it
'resets the text search filter'
do
visit_issues
(
project
,
issue_search:
'Bug'
)
fill_in
'issue_search'
,
with:
'Bug'
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -48,7 +47,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -48,7 +47,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when author filter has been applied'
do
context
'when author filter has been applied'
do
it
'resets the author filter'
do
it
'resets the author filter'
do
filter_by_author
(
user
.
name
)
visit_issues
(
project
,
author_id:
user
.
id
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -58,7 +57,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -58,7 +57,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when assignee filter has been applied'
do
context
'when assignee filter has been applied'
do
it
'resets the assignee filter'
do
it
'resets the assignee filter'
do
filter_by_assignee
(
user
.
name
)
visit_issues
(
project
,
assignee_id:
user
.
id
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
reset_filters
reset_filters
...
@@ -68,17 +67,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -68,17 +67,7 @@ feature 'Issues filter reset button', feature: true, js: true do
context
'when all filters have been applied'
do
context
'when all filters have been applied'
do
it
'resets all filters'
do
it
'resets all filters'
do
visit_issues
(
project
,
assignee_id:
user
.
id
,
author_id:
user
.
id
,
milestone_title:
milestone
.
title
,
label_name:
bug
.
name
,
issue_search:
'Bug'
)
wait_for_ajax
filter_by_milestone
(
milestone
.
title
)
wait_for_ajax
filter_by_author
(
user
.
username
)
wait_for_ajax
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
reset_filters
reset_filters
...
@@ -86,33 +75,7 @@ feature 'Issues filter reset button', feature: true, js: true do
...
@@ -86,33 +75,7 @@ feature 'Issues filter reset button', feature: true, js: true do
end
end
end
end
def
filter_by_milestone
(
title
)
find
(
'.js-milestone-select'
).
click
find
(
'.milestone-filter .dropdown-content a'
,
text:
title
).
click
end
def
filter_by_label
(
title
)
find
(
'.js-label-select'
).
click
find
(
'.labels-filter .dropdown-content a'
,
text:
title
).
click
find
(
'.labels-filter .dropdown-title .dropdown-menu-close-icon'
).
click
end
def
filter_by_author
(
name
)
find
(
'.js-author-search'
).
click
find
(
'.dropdown-menu-author .dropdown-content a'
,
text:
name
).
click
end
def
filter_by_assignee
(
name
)
find
(
'.js-assignee-search'
).
click
find
(
'.dropdown-menu-assignee .dropdown-content a'
,
text:
name
).
click
end
def
reset_filters
def
reset_filters
find
(
'.reset-filters'
).
click
find
(
'.reset-filters'
).
click
wait_for_ajax
end
def
visit_issues
(
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录