Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0ee548d3
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,发现更多精彩内容 >>
提交
0ee548d3
编写于
8月 09, 2016
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added some tests
上级
71605f31
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
211 addition
and
35 deletion
+211
-35
app/assets/javascripts/boards/test_utils/simulate_drag.js
app/assets/javascripts/boards/test_utils/simulate_drag.js
+1
-0
app/views/projects/boards/show.html.haml
app/views/projects/boards/show.html.haml
+1
-1
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+209
-34
未找到文件。
app/assets/javascripts/boards/test_utils/simulate_drag.js
浏览文件 @
0ee548d3
...
...
@@ -3,6 +3,7 @@
function
simulateEvent
(
el
,
type
,
options
)
{
var
event
;
if
(
!
el
)
return
;
var
ownerDocument
=
el
.
ownerDocument
;
options
=
options
||
{};
...
...
app/views/projects/boards/show.html.haml
浏览文件 @
0ee548d3
...
...
@@ -4,7 +4,7 @@
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
'boards/boards_bundle.js'
)
=
page_specific_javascript_tag
(
'boards/test_utils/simulate_drag.js'
)
if
Rails
.
env
.
test?
=
page_specific_javascript_tag
(
'boards/test_utils/simulate_drag.js'
)
=
render
"projects/issues/head"
...
...
spec/features/boards/boards_spec.rb
浏览文件 @
0ee548d3
...
...
@@ -3,64 +3,239 @@ require 'rails_helper'
describe
'Issue Boards'
,
feature:
true
,
js:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let!
(
:board
)
{
Boards
::
CreateService
.
new
(
project
,
user
).
execute
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
end
context
'no lists'
do
before
do
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
end
it
'shows default lists'
do
lists
=
all
(
'.board'
)
it
'shows blank state'
do
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
expect
(
page
).
to
have_content
(
'Welcome to your Issue Board!'
)
end
page
.
within
lists
.
first
do
expect
(
page
).
to
have_content
'Backlog'
it
'hides the blank state when clicking nermind button'
do
page
.
within
(
'.board-blank-state'
)
do
click_button
(
'Nevermind, I\'ll use my own'
)
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
2
)
end
it
'creates default lists'
do
lists
=
[
'Backlog'
,
'Development'
,
'Testing'
,
'Production'
,
'Ready'
,
'Done'
]
page
.
within
lists
.
last
do
expect
(
page
).
to
have_content
'Done'
page
.
within
(
'.board-blank-state'
)
do
click_button
(
'Add default lists'
)
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
6
)
page
.
all
(
'.board'
).
each_with_index
do
|
list
,
i
|
expect
(
list
.
find
(
'.board-title'
)).
to
have_content
(
lists
[
i
])
end
end
end
it
'removes blank state list'
do
click_button
'Nevermind, i\'ll use my own'
context
'with lists'
do
let
(
:planning
)
{
create
(
:label
,
project:
project
,
name:
'Planning'
)
}
let
(
:development
)
{
create
(
:label
,
project:
project
,
name:
'Development'
)
}
let
(
:testing
)
{
create
(
:label
,
project:
project
,
name:
'Testing'
)
}
expect
(
page
).
to
have_selector
(
'.board'
,
count:
2
)
let!
(
:list1
)
{
create
(
:list
,
board:
project
.
board
,
label:
planning
,
position:
0
)
}
let!
(
:list2
)
{
create
(
:list
,
board:
project
.
board
,
label:
development
,
position:
1
)
}
let!
(
:issue1
)
{
create
(
:issue
,
project:
project
,
assignee:
user
)
}
let!
(
:issue2
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:issue3
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:issue4
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:issue5
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
])
}
let!
(
:issue6
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
,
development
])
}
let!
(
:issue7
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
])
}
let!
(
:issue8
)
{
create
(
:closed_issue
,
project:
project
)
}
let!
(
:issue9
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
testing
])
}
before
do
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
sleep
1
end
it
'can drag card to new list'
do
sleep
0.5
lists
=
all
(
'.board'
)
drag_to
(
list_from_index:
0
,
list_to_index:
1
)
it
'shows lists'
do
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
end
page
.
within
lists
[
1
].
find
(
'.board-list'
)
do
expect
(
page
).
to
have_content
(
'Test'
)
it
'shows issues in lists'
do
page
.
within
(
all
(
'.board'
)[
1
])
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'2'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
2
)
end
page
.
within
first
(
'.card .card-footer'
)
do
expect
(
page
).
to
have_content
'Frontend'
page
.
within
(
all
(
'.board'
)[
2
])
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'2'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
2
)
end
end
it
'allows user to delete board'
do
page
.
within
(
all
(
'.board'
)[
1
])
do
find
(
'.board-delete'
).
click
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
end
it
'removes all labels from card'
do
sleep
0.5
lists
=
all
(
'.board'
)
drag_to
(
list_from_index:
1
,
list_to_index:
3
)
context
'backlog'
do
it
'shows issues in backlog with no labels'
do
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'5'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
5
)
end
end
it
'is searchable'
do
page
.
within
(
first
(
'.board'
))
do
find
(
'.form-control'
).
set
issue1
.
title
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
end
it
'clears search'
do
page
.
within
(
first
(
'.board'
))
do
find
(
'.form-control'
).
set
issue1
.
title
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
find
(
'.board-search-clear-btn'
).
click
page
.
within
lists
[
3
].
find
(
'.board-list'
)
do
expect
(
page
).
to
have_content
(
'Frontend bug'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
2
)
end
end
it
'moves issue from backlog into list'
do
drag_to
(
list_to_index:
1
)
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'3'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
3
)
end
page
.
within
(
all
(
'.board'
)[
1
])
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'3'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
3
)
all
(
'.card'
).
each
do
|
card
|
expect
(
card
.
all
(
'.label'
).
last
).
to
have_content
(
planning
.
title
)
end
end
end
end
context
'done'
do
it
'shows list of done issues'
do
expect
(
all
(
'.board'
).
last
).
to
have_selector
(
'.card'
,
count:
1
)
end
it
'moves issue to done'
do
drag_to
(
list_from_index:
0
,
list_to_index:
3
)
expect
(
all
(
'.board'
).
last
).
to
have_selector
(
'.card'
,
count:
2
)
expect
(
all
(
'.board'
).
last
).
to
have_content
(
issue4
.
title
)
expect
(
all
(
'.board'
).
last
).
not_to
have_content
(
planning
.
title
)
end
it
'removes all of the same issue to done'
do
drag_to
(
list_from_index:
1
,
list_to_index:
3
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
).
last
).
to
have_content
(
issue6
.
title
)
expect
(
all
(
'.board'
).
last
).
not_to
have_content
(
planning
.
title
)
end
end
page
.
within
first
(
'.card .card-footer'
)
do
expect
(
page
).
not_to
have_content
'Frontend'
context
'lists'
do
it
'moves between lists'
do
drag_to
(
list_from_index:
1
,
card_index:
1
,
list_to_index:
2
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
3
)
expect
(
all
(
'.board'
)[
2
]).
to
have_content
(
issue5
.
title
)
expect
(
all
(
'.board'
)[
2
].
all
(
'.card'
).
last
).
to
have_content
(
development
.
title
)
end
it
'moves between lists'
do
drag_to
(
list_from_index:
2
,
list_to_index:
1
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
3
)
expect
(
all
(
'.board'
)[
2
]).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
all
(
'.board'
)[
1
]).
to
have_content
(
issue7
.
title
)
expect
(
all
(
'.board'
)[
1
].
all
(
'.card'
).
first
).
to
have_content
(
planning
.
title
)
end
it
'moves from done'
do
drag_to
(
list_from_index:
3
,
list_to_index:
1
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
3
)
expect
(
all
(
'.board'
)[
1
]).
to
have_content
(
issue8
.
title
)
expect
(
all
(
'.board'
)[
1
].
all
(
'.card'
).
first
).
to
have_content
(
planning
.
title
)
end
context
'issue card'
do
it
'shows assignee'
do
page
.
within
(
first
(
'.board'
))
do
expect
(
all
(
'.card'
).
last
).
to
have_selector
(
'.avatar'
)
end
end
end
page
.
within
lists
[
1
].
find
(
'.board-list'
)
do
expect
(
page
).
not_to
have_content
(
'Frontend bug'
)
expect
(
page
).
not_to
have_selector
(
'.card'
)
context
'new list'
do
it
'shows all labels in new list dropdown'
do
click_button
'Create new list'
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
expect
(
page
).
to
have_content
(
planning
.
title
)
expect
(
page
).
to
have_content
(
development
.
title
)
expect
(
page
).
to
have_content
(
testing
.
title
)
end
end
it
'creates new list for label'
do
click_button
'Create new list'
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
click_link
testing
.
title
end
expect
(
page
).
to
have_selector
(
'.board'
,
count:
5
)
end
it
'moves issues from backlog into new list'
do
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'5'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
5
)
end
click_button
'Create new list'
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
click_link
testing
.
title
end
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'4'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
4
)
end
end
end
end
context
'filtering'
do
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录