Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1fb9de2b
Commit
1fb9de2b
authored
Mar 24, 2017
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change Done column to Closed in issue boards
parent
6eeba4b1
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
66 additions
and
62 deletions
+66
-62
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+1
-1
app/assets/javascripts/boards/components/sidebar/remove_issue.js
...ets/javascripts/boards/components/sidebar/remove_issue.js
+1
-1
app/assets/javascripts/boards/models/list.js
app/assets/javascripts/boards/models/list.js
+1
-1
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+2
-2
app/models/board.rb
app/models/board.rb
+2
-2
app/models/list.rb
app/models/list.rb
+1
-1
app/services/boards/create_service.rb
app/services/boards/create_service.rb
+1
-1
app/services/boards/issues/list_service.rb
app/services/boards/issues/list_service.rb
+1
-1
app/services/boards/issues/move_service.rb
app/services/boards/issues/move_service.rb
+2
-2
app/views/projects/boards/components/_board.html.haml
app/views/projects/boards/components/_board.html.haml
+2
-2
app/views/projects/boards/components/_board_list.html.haml
app/views/projects/boards/components/_board_list.html.haml
+1
-1
changelogs/unreleased/rename_done_to_closed.yml
changelogs/unreleased/rename_done_to_closed.yml
+4
-0
doc/api/boards.md
doc/api/boards.md
+1
-1
spec/factories/boards.rb
spec/factories/boards.rb
+1
-1
spec/factories/lists.rb
spec/factories/lists.rb
+2
-2
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+11
-11
spec/features/boards/new_issue_spec.rb
spec/features/boards/new_issue_spec.rb
+1
-1
spec/fixtures/api/schemas/list.json
spec/fixtures/api/schemas/list.json
+1
-1
spec/javascripts/boards/boards_store_spec.js
spec/javascripts/boards/boards_store_spec.js
+2
-2
spec/models/list_spec.rb
spec/models/list_spec.rb
+11
-11
spec/services/boards/create_service_spec.rb
spec/services/boards/create_service_spec.rb
+1
-1
spec/services/boards/issues/list_service_spec.rb
spec/services/boards/issues/list_service_spec.rb
+3
-3
spec/services/boards/issues/move_service_spec.rb
spec/services/boards/issues/move_service_spec.rb
+5
-5
spec/services/boards/lists/destroy_service_spec.rb
spec/services/boards/lists/destroy_service_spec.rb
+4
-4
spec/services/boards/lists/list_service_spec.rb
spec/services/boards/lists/list_service_spec.rb
+1
-1
spec/services/boards/lists/move_service_spec.rb
spec/services/boards/lists/move_service_spec.rb
+3
-3
No files found.
app/assets/javascripts/boards/boards_bundle.js
View file @
1fb9de2b
...
@@ -79,7 +79,7 @@ $(() => {
...
@@ -79,7 +79,7 @@ $(() => {
resp
.
json
().
forEach
((
board
)
=>
{
resp
.
json
().
forEach
((
board
)
=>
{
const
list
=
Store
.
addList
(
board
);
const
list
=
Store
.
addList
(
board
);
if
(
list
.
type
===
'
done
'
)
{
if
(
list
.
type
===
'
closed
'
)
{
list
.
position
=
Infinity
;
list
.
position
=
Infinity
;
}
}
});
});
...
...
app/assets/javascripts/boards/components/sidebar/remove_issue.js
View file @
1fb9de2b
...
@@ -48,7 +48,7 @@ import Vue from 'vue';
...
@@ -48,7 +48,7 @@ import Vue from 'vue';
template
:
`
template
:
`
<div
<div
class="block list"
class="block list"
v-if="list.type !== '
done
'">
v-if="list.type !== '
closed
'">
<button
<button
class="btn btn-default btn-block"
class="btn btn-default btn-block"
type="button"
type="button"
...
...
app/assets/javascripts/boards/models/list.js
View file @
1fb9de2b
...
@@ -10,7 +10,7 @@ class List {
...
@@ -10,7 +10,7 @@ class List {
this
.
position
=
obj
.
position
;
this
.
position
=
obj
.
position
;
this
.
title
=
obj
.
title
;
this
.
title
=
obj
.
title
;
this
.
type
=
obj
.
list_type
;
this
.
type
=
obj
.
list_type
;
this
.
preset
=
[
'
done
'
,
'
blank
'
].
indexOf
(
this
.
type
)
>
-
1
;
this
.
preset
=
[
'
closed
'
,
'
blank
'
].
indexOf
(
this
.
type
)
>
-
1
;
this
.
page
=
1
;
this
.
page
=
1
;
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
loadingMore
=
false
;
this
.
loadingMore
=
false
;
...
...
app/assets/javascripts/boards/stores/boards_store.js
View file @
1fb9de2b
...
@@ -45,7 +45,7 @@ import Cookies from 'js-cookie';
...
@@ -45,7 +45,7 @@ import Cookies from 'js-cookie';
},
},
shouldAddBlankState
()
{
shouldAddBlankState
()
{
// Decide whether to add the blank state
// Decide whether to add the blank state
return
!
(
this
.
state
.
lists
.
filter
(
list
=>
list
.
type
!==
'
done
'
)[
0
]);
return
!
(
this
.
state
.
lists
.
filter
(
list
=>
list
.
type
!==
'
closed
'
)[
0
]);
},
},
addBlankState
()
{
addBlankState
()
{
if
(
!
this
.
shouldAddBlankState
()
||
this
.
welcomeIsHidden
()
||
this
.
disabled
)
return
;
if
(
!
this
.
shouldAddBlankState
()
||
this
.
welcomeIsHidden
()
||
this
.
disabled
)
return
;
...
@@ -98,7 +98,7 @@ import Cookies from 'js-cookie';
...
@@ -98,7 +98,7 @@ import Cookies from 'js-cookie';
issueTo
.
removeLabel
(
listFrom
.
label
);
issueTo
.
removeLabel
(
listFrom
.
label
);
}
}
if
(
listTo
.
type
===
'
done
'
)
{
if
(
listTo
.
type
===
'
closed
'
)
{
issueLists
.
forEach
((
list
)
=>
{
issueLists
.
forEach
((
list
)
=>
{
list
.
removeIssue
(
issue
);
list
.
removeIssue
(
issue
);
});
});
...
...
app/models/board.rb
View file @
1fb9de2b
...
@@ -5,7 +5,7 @@ class Board < ActiveRecord::Base
...
@@ -5,7 +5,7 @@ class Board < ActiveRecord::Base
validates
:project
,
presence:
true
validates
:project
,
presence:
true
def
done
_list
def
closed
_list
lists
.
merge
(
List
.
done
).
take
lists
.
merge
(
List
.
closed
).
take
end
end
end
end
app/models/list.rb
View file @
1fb9de2b
...
@@ -2,7 +2,7 @@ class List < ActiveRecord::Base
...
@@ -2,7 +2,7 @@ class List < ActiveRecord::Base
belongs_to
:board
belongs_to
:board
belongs_to
:label
belongs_to
:label
enum
list_type:
{
label:
1
,
done
:
2
}
enum
list_type:
{
label:
1
,
closed
:
2
}
validates
:board
,
:list_type
,
presence:
true
validates
:board
,
:list_type
,
presence:
true
validates
:label
,
:position
,
presence:
true
,
if: :label?
validates
:label
,
:position
,
presence:
true
,
if: :label?
...
...
app/services/boards/create_service.rb
View file @
1fb9de2b
...
@@ -12,7 +12,7 @@ module Boards
...
@@ -12,7 +12,7 @@ module Boards
def
create_board!
def
create_board!
board
=
project
.
boards
.
create
board
=
project
.
boards
.
create
board
.
lists
.
create
(
list_type: :
done
)
board
.
lists
.
create
(
list_type: :
closed
)
board
board
end
end
...
...
app/services/boards/issues/list_service.rb
View file @
1fb9de2b
...
@@ -41,7 +41,7 @@ module Boards
...
@@ -41,7 +41,7 @@ module Boards
end
end
def
set_state
def
set_state
params
[
:state
]
=
list
&&
list
.
done
?
?
'closed'
:
'opened'
params
[
:state
]
=
list
&&
list
.
closed
?
?
'closed'
:
'opened'
end
end
def
board_label_ids
def
board_label_ids
...
...
app/services/boards/issues/move_service.rb
View file @
1fb9de2b
...
@@ -48,8 +48,8 @@ module Boards
...
@@ -48,8 +48,8 @@ module Boards
end
end
def
issue_state
def
issue_state
return
'reopen'
if
moving_from_list
.
done
?
return
'reopen'
if
moving_from_list
.
closed
?
return
'close'
if
moving_to_list
.
done
?
return
'close'
if
moving_to_list
.
closed
?
end
end
def
add_label_ids
def
add_label_ids
...
...
app/views/projects/boards/components/_board.html.haml
View file @
1fb9de2b
...
@@ -7,12 +7,12 @@
...
@@ -7,12 +7,12 @@
data:
{
container:
"body"
,
placement:
"bottom"
}
}
data:
{
container:
"body"
,
placement:
"bottom"
}
}
{{ list.title }}
{{ list.title }}
.board-issue-count-holder.pull-right.clearfix
{
"v-if"
=>
'list.type !== "blank"'
}
.board-issue-count-holder.pull-right.clearfix
{
"v-if"
=>
'list.type !== "blank"'
}
%span
.board-issue-count.pull-left
{
":class"
=>
'
{
"has-btn"
:
list
.
type
!==
"
done
"
&&
!
disabled
}
'
}
%span
.board-issue-count.pull-left
{
":class"
=>
'
{
"has-btn"
:
list
.
type
!==
"
closed
"
&&
!
disabled
}
'
}
{{ list.issuesSize }}
{{ list.issuesSize }}
-
if
can?
(
current_user
,
:admin_issue
,
@project
)
-
if
can?
(
current_user
,
:admin_issue
,
@project
)
%button
.btn.btn-small.btn-default.pull-right.has-tooltip
{
type:
"button"
,
%button
.btn.btn-small.btn-default.pull-right.has-tooltip
{
type:
"button"
,
"@click"
=>
"showNewIssueForm"
,
"@click"
=>
"showNewIssueForm"
,
"v-if"
=>
'list.type !== "
done
"'
,
"v-if"
=>
'list.type !== "
closed
"'
,
"aria-label"
=>
"Add an issue"
,
"aria-label"
=>
"Add an issue"
,
"title"
=>
"Add an issue"
,
"title"
=>
"Add an issue"
,
data:
{
placement:
"top"
,
container:
"body"
}
}
data:
{
placement:
"top"
,
container:
"body"
}
}
...
...
app/views/projects/boards/components/_board_list.html.haml
View file @
1fb9de2b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
=
icon
(
"spinner spin"
)
=
icon
(
"spinner spin"
)
-
if
can?
current_user
,
:create_issue
,
@project
-
if
can?
current_user
,
:create_issue
,
@project
%board-new-issue
{
":list"
=>
"list"
,
%board-new-issue
{
":list"
=>
"list"
,
"v-if"
=>
'list.type !== "
done
" && showIssueForm'
}
"v-if"
=>
'list.type !== "
closed
" && showIssueForm'
}
%ul
.board-list
{
"ref"
=>
"list"
,
%ul
.board-list
{
"ref"
=>
"list"
,
"v-show"
=>
"!loading"
,
"v-show"
=>
"!loading"
,
":data-board"
=>
"list.id"
,
":data-board"
=>
"list.id"
,
...
...
changelogs/unreleased/rename_done_to_closed.yml
0 → 100644
View file @
1fb9de2b
---
title
:
Change Done column to Closed in issue boards
merge_request
:
10198
author
:
blackst0ne
doc/api/boards.md
View file @
1fb9de2b
...
@@ -63,7 +63,7 @@ Example response:
...
@@ -63,7 +63,7 @@ Example response:
## List board lists
## List board lists
Get a list of the board's lists.
Get a list of the board's lists.
Does not include
`backlog`
and
`
done
`
lists
Does not include
`backlog`
and
`
closed
`
lists
```
```
GET /projects/:id/boards/:board_id/lists
GET /projects/:id/boards/:board_id/lists
...
...
spec/factories/boards.rb
View file @
1fb9de2b
...
@@ -3,7 +3,7 @@ FactoryGirl.define do
...
@@ -3,7 +3,7 @@ FactoryGirl.define do
project
factory: :empty_project
project
factory: :empty_project
after
(
:create
)
do
|
board
|
after
(
:create
)
do
|
board
|
board
.
lists
.
create
(
list_type: :
done
)
board
.
lists
.
create
(
list_type: :
closed
)
end
end
end
end
end
end
spec/factories/lists.rb
View file @
1fb9de2b
...
@@ -6,8 +6,8 @@ FactoryGirl.define do
...
@@ -6,8 +6,8 @@ FactoryGirl.define do
sequence
(
:position
)
sequence
(
:position
)
end
end
factory
:
done
_list
,
parent: :list
do
factory
:
closed
_list
,
parent: :list
do
list_type
:
done
list_type
:
closed
label
nil
label
nil
position
nil
position
nil
end
end
...
...
spec/features/boards/boards_spec.rb
View file @
1fb9de2b
...
@@ -42,7 +42,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -42,7 +42,7 @@ describe 'Issue Boards', feature: true, js: true do
end
end
it
'creates default lists'
do
it
'creates default lists'
do
lists
=
[
'To Do'
,
'Doing'
,
'
Done
'
]
lists
=
[
'To Do'
,
'Doing'
,
'
Closed
'
]
page
.
within
(
find
(
'.board-blank-state'
))
do
page
.
within
(
find
(
'.board-blank-state'
))
do
click_button
(
'Add default lists'
)
click_button
(
'Add default lists'
)
...
@@ -65,7 +65,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -65,7 +65,7 @@ describe 'Issue Boards', feature: true, js: true do
let
(
:testing
)
{
create
(
:label
,
project:
project
,
name:
'Testing'
)
}
let
(
:testing
)
{
create
(
:label
,
project:
project
,
name:
'Testing'
)
}
let
(
:bug
)
{
create
(
:label
,
project:
project
,
name:
'Bug'
)
}
let
(
:bug
)
{
create
(
:label
,
project:
project
,
name:
'Bug'
)
}
let!
(
:backlog
)
{
create
(
:label
,
project:
project
,
name:
'Backlog'
)
}
let!
(
:backlog
)
{
create
(
:label
,
project:
project
,
name:
'Backlog'
)
}
let!
(
:
done
)
{
create
(
:label
,
project:
project
,
name:
'Done
'
)
}
let!
(
:
closed
)
{
create
(
:label
,
project:
project
,
name:
'Closed
'
)
}
let!
(
:accepting
)
{
create
(
:label
,
project:
project
,
name:
'Accepting Merge Requests'
)
}
let!
(
:accepting
)
{
create
(
:label
,
project:
project
,
name:
'Accepting Merge Requests'
)
}
let!
(
:list1
)
{
create
(
:list
,
board:
board
,
label:
planning
,
position:
0
)
}
let!
(
:list1
)
{
create
(
:list
,
board:
board
,
label:
planning
,
position:
0
)
}
...
@@ -114,7 +114,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -114,7 +114,7 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
it
'search
done
list'
do
it
'search
closed
list'
do
find
(
'.filtered-search'
).
set
(
issue8
.
title
)
find
(
'.filtered-search'
).
set
(
issue8
.
title
)
find
(
'.filtered-search'
).
native
.
send_keys
(
:enter
)
find
(
'.filtered-search'
).
native
.
send_keys
(
:enter
)
...
@@ -186,13 +186,13 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -186,13 +186,13 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
context
'
done
'
do
context
'
closed
'
do
it
'shows list of
done
issues'
do
it
'shows list of
closed
issues'
do
wait_for_board_cards
(
3
,
1
)
wait_for_board_cards
(
3
,
1
)
wait_for_ajax
wait_for_ajax
end
end
it
'moves issue to
done
'
do
it
'moves issue to
closed
'
do
drag
(
list_from_index:
0
,
list_to_index:
2
)
drag
(
list_from_index:
0
,
list_to_index:
2
)
wait_for_board_cards
(
1
,
7
)
wait_for_board_cards
(
1
,
7
)
...
@@ -205,7 +205,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -205,7 +205,7 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
find
(
'.board:nth-child(3)'
)).
not_to
have_content
(
planning
.
title
)
expect
(
find
(
'.board:nth-child(3)'
)).
not_to
have_content
(
planning
.
title
)
end
end
it
'removes all of the same issue to
done
'
do
it
'removes all of the same issue to
closed
'
do
drag
(
list_from_index:
0
,
list_to_index:
2
)
drag
(
list_from_index:
0
,
list_to_index:
2
)
wait_for_board_cards
(
1
,
7
)
wait_for_board_cards
(
1
,
7
)
...
@@ -252,7 +252,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -252,7 +252,7 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
find
(
'.board:nth-child(1)'
).
all
(
'.card'
).
first
).
not_to
have_content
(
planning
.
title
)
expect
(
find
(
'.board:nth-child(1)'
).
all
(
'.card'
).
first
).
not_to
have_content
(
planning
.
title
)
end
end
it
'issue moves from
done
'
do
it
'issue moves from
closed
'
do
drag
(
list_from_index:
2
,
list_to_index:
1
)
drag
(
list_from_index:
2
,
list_to_index:
1
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_content
(
issue8
.
title
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_content
(
issue8
.
title
)
...
@@ -308,12 +308,12 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -308,12 +308,12 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
end
end
it
'creates new list for
Done
label'
do
it
'creates new list for
Closed
label'
do
click_button
'Add list'
click_button
'Add list'
wait_for_ajax
wait_for_ajax
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
click_link
done
.
title
click_link
closed
.
title
end
end
wait_for_vue_resource
wait_for_vue_resource
...
@@ -326,7 +326,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -326,7 +326,7 @@ describe 'Issue Boards', feature: true, js: true do
wait_for_ajax
wait_for_ajax
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
click_link
done
.
title
click_link
closed
.
title
end
end
wait_for_vue_resource
wait_for_vue_resource
...
...
spec/features/boards/new_issue_spec.rb
View file @
1fb9de2b
...
@@ -25,7 +25,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
...
@@ -25,7 +25,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.board-issue-count-holder .btn'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.board-issue-count-holder .btn'
,
count:
1
)
end
end
it
'does not display new issue button in
done
list'
do
it
'does not display new issue button in
closed
list'
do
page
.
within
(
'.board:nth-child(2)'
)
do
page
.
within
(
'.board:nth-child(2)'
)
do
expect
(
page
).
not_to
have_selector
(
'.board-issue-count-holder .btn'
)
expect
(
page
).
not_to
have_selector
(
'.board-issue-count-holder .btn'
)
end
end
...
...
spec/fixtures/api/schemas/list.json
View file @
1fb9de2b
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
"id"
:
{
"type"
:
"integer"
},
"id"
:
{
"type"
:
"integer"
},
"list_type"
:
{
"list_type"
:
{
"type"
:
"string"
,
"type"
:
"string"
,
"enum"
:
[
"label"
,
"
done
"
]
"enum"
:
[
"label"
,
"
closed
"
]
},
},
"label"
:
{
"label"
:
{
"type"
:
[
"object"
,
"null"
],
"type"
:
[
"object"
,
"null"
],
...
...
spec/javascripts/boards/boards_store_spec.js
View file @
1fb9de2b
...
@@ -106,9 +106,9 @@ describe('Store', () => {
...
@@ -106,9 +106,9 @@ describe('Store', () => {
expect
(
gl
.
issueBoards
.
BoardsStore
.
shouldAddBlankState
()).
toBe
(
false
);
expect
(
gl
.
issueBoards
.
BoardsStore
.
shouldAddBlankState
()).
toBe
(
false
);
});
});
it
(
'
check for blank state adding when
done
list exist
'
,
()
=>
{
it
(
'
check for blank state adding when
closed
list exist
'
,
()
=>
{
gl
.
issueBoards
.
BoardsStore
.
addList
({
gl
.
issueBoards
.
BoardsStore
.
addList
({
list_type
:
'
done
'
list_type
:
'
closed
'
});
});
expect
(
gl
.
issueBoards
.
BoardsStore
.
shouldAddBlankState
()).
toBe
(
true
);
expect
(
gl
.
issueBoards
.
BoardsStore
.
shouldAddBlankState
()).
toBe
(
true
);
...
...
spec/models/list_spec.rb
View file @
1fb9de2b
...
@@ -19,8 +19,8 @@ describe List do
...
@@ -19,8 +19,8 @@ describe List do
expect
(
subject
).
to
validate_uniqueness_of
(
:label_id
).
scoped_to
(
:board_id
)
expect
(
subject
).
to
validate_uniqueness_of
(
:label_id
).
scoped_to
(
:board_id
)
end
end
context
'when list_type is set to
done
'
do
context
'when list_type is set to
closed
'
do
subject
{
described_class
.
new
(
list_type: :
done
)
}
subject
{
described_class
.
new
(
list_type: :
closed
)
}
it
{
is_expected
.
not_to
validate_presence_of
(
:label
)
}
it
{
is_expected
.
not_to
validate_presence_of
(
:label
)
}
it
{
is_expected
.
not_to
validate_presence_of
(
:position
)
}
it
{
is_expected
.
not_to
validate_presence_of
(
:position
)
}
...
@@ -34,8 +34,8 @@ describe List do
...
@@ -34,8 +34,8 @@ describe List do
expect
(
subject
.
destroy
).
to
be_truthy
expect
(
subject
.
destroy
).
to
be_truthy
end
end
it
'can not be destroyed when when list_type is set to
done
'
do
it
'can not be destroyed when when list_type is set to
closed
'
do
subject
=
create
(
:
done
_list
)
subject
=
create
(
:
closed
_list
)
expect
(
subject
.
destroy
).
to
be_falsey
expect
(
subject
.
destroy
).
to
be_falsey
end
end
...
@@ -48,8 +48,8 @@ describe List do
...
@@ -48,8 +48,8 @@ describe List do
expect
(
subject
).
to
be_destroyable
expect
(
subject
).
to
be_destroyable
end
end
it
'returns false when list_type is set to
done
'
do
it
'returns false when list_type is set to
closed
'
do
subject
.
list_type
=
:
done
subject
.
list_type
=
:
closed
expect
(
subject
).
not_to
be_destroyable
expect
(
subject
).
not_to
be_destroyable
end
end
...
@@ -62,8 +62,8 @@ describe List do
...
@@ -62,8 +62,8 @@ describe List do
expect
(
subject
).
to
be_movable
expect
(
subject
).
to
be_movable
end
end
it
'returns false when list_type is set to
done
'
do
it
'returns false when list_type is set to
closed
'
do
subject
.
list_type
=
:
done
subject
.
list_type
=
:
closed
expect
(
subject
).
not_to
be_movable
expect
(
subject
).
not_to
be_movable
end
end
...
@@ -77,10 +77,10 @@ describe List do
...
@@ -77,10 +77,10 @@ describe List do
expect
(
subject
.
title
).
to
eq
'Development'
expect
(
subject
.
title
).
to
eq
'Development'
end
end
it
'returns
Done when list_type is set to done
'
do
it
'returns
Closed when list_type is set to closed
'
do
subject
.
list_type
=
:
done
subject
.
list_type
=
:
closed
expect
(
subject
.
title
).
to
eq
'
Done
'
expect
(
subject
.
title
).
to
eq
'
Closed
'
end
end
end
end
end
end
spec/services/boards/create_service_spec.rb
View file @
1fb9de2b
...
@@ -15,7 +15,7 @@ describe Boards::CreateService, services: true do
...
@@ -15,7 +15,7 @@ describe Boards::CreateService, services: true do
board
=
service
.
execute
board
=
service
.
execute
expect
(
board
.
lists
.
size
).
to
eq
1
expect
(
board
.
lists
.
size
).
to
eq
1
expect
(
board
.
lists
.
first
).
to
be_
done
expect
(
board
.
lists
.
first
).
to
be_
closed
end
end
end
end
...
...
spec/services/boards/issues/list_service_spec.rb
View file @
1fb9de2b
...
@@ -15,7 +15,7 @@ describe Boards::Issues::ListService, services: true do
...
@@ -15,7 +15,7 @@ describe Boards::Issues::ListService, services: true do
let!
(
:list1
)
{
create
(
:list
,
board:
board
,
label:
development
,
position:
0
)
}
let!
(
:list1
)
{
create
(
:list
,
board:
board
,
label:
development
,
position:
0
)
}
let!
(
:list2
)
{
create
(
:list
,
board:
board
,
label:
testing
,
position:
1
)
}
let!
(
:list2
)
{
create
(
:list
,
board:
board
,
label:
testing
,
position:
1
)
}
let!
(
:
done
)
{
create
(
:done
_list
,
board:
board
)
}
let!
(
:
closed
)
{
create
(
:closed
_list
,
board:
board
)
}
let!
(
:opened_issue1
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
bug
])
}
let!
(
:opened_issue1
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
bug
])
}
let!
(
:opened_issue2
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
p2
])
}
let!
(
:opened_issue2
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
p2
])
}
...
@@ -53,8 +53,8 @@ describe Boards::Issues::ListService, services: true do
...
@@ -53,8 +53,8 @@ describe Boards::Issues::ListService, services: true do
expect
(
issues
).
to
eq
[
opened_issue2
,
reopened_issue1
,
opened_issue1
]
expect
(
issues
).
to
eq
[
opened_issue2
,
reopened_issue1
,
opened_issue1
]
end
end
it
'returns closed issues when listing issues from
Done
'
do
it
'returns closed issues when listing issues from
Closed
'
do
params
=
{
board_id:
board
.
id
,
id:
done
.
id
}
params
=
{
board_id:
board
.
id
,
id:
closed
.
id
}
issues
=
described_class
.
new
(
project
,
user
,
params
).
execute
issues
=
described_class
.
new
(
project
,
user
,
params
).
execute
...
...
spec/services/boards/issues/move_service_spec.rb
View file @
1fb9de2b
...
@@ -12,7 +12,7 @@ describe Boards::Issues::MoveService, services: true do
...
@@ -12,7 +12,7 @@ describe Boards::Issues::MoveService, services: true do
let!
(
:list1
)
{
create
(
:list
,
board:
board1
,
label:
development
,
position:
0
)
}
let!
(
:list1
)
{
create
(
:list
,
board:
board1
,
label:
development
,
position:
0
)
}
let!
(
:list2
)
{
create
(
:list
,
board:
board1
,
label:
testing
,
position:
1
)
}
let!
(
:list2
)
{
create
(
:list
,
board:
board1
,
label:
testing
,
position:
1
)
}
let!
(
:
done
)
{
create
(
:done
_list
,
board:
board1
)
}
let!
(
:
closed
)
{
create
(
:closed
_list
,
board:
board1
)
}
before
do
before
do
project
.
team
<<
[
user
,
:developer
]
project
.
team
<<
[
user
,
:developer
]
...
@@ -35,13 +35,13 @@ describe Boards::Issues::MoveService, services: true do
...
@@ -35,13 +35,13 @@ describe Boards::Issues::MoveService, services: true do
end
end
end
end
context
'when moving to
done
'
do
context
'when moving to
closed
'
do
let
(
:board2
)
{
create
(
:board
,
project:
project
)
}
let
(
:board2
)
{
create
(
:board
,
project:
project
)
}
let
(
:regression
)
{
create
(
:label
,
project:
project
,
name:
'Regression'
)
}
let
(
:regression
)
{
create
(
:label
,
project:
project
,
name:
'Regression'
)
}
let!
(
:list3
)
{
create
(
:list
,
board:
board2
,
label:
regression
,
position:
1
)
}
let!
(
:list3
)
{
create
(
:list
,
board:
board2
,
label:
regression
,
position:
1
)
}
let
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
bug
,
development
,
testing
,
regression
])
}
let
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
bug
,
development
,
testing
,
regression
])
}
let
(
:params
)
{
{
board_id:
board1
.
id
,
from_list_id:
list2
.
id
,
to_list_id:
done
.
id
}
}
let
(
:params
)
{
{
board_id:
board1
.
id
,
from_list_id:
list2
.
id
,
to_list_id:
closed
.
id
}
}
it
'delegates the close proceedings to Issues::CloseService'
do
it
'delegates the close proceedings to Issues::CloseService'
do
expect_any_instance_of
(
Issues
::
CloseService
).
to
receive
(
:execute
).
with
(
issue
).
once
expect_any_instance_of
(
Issues
::
CloseService
).
to
receive
(
:execute
).
with
(
issue
).
once
...
@@ -58,9 +58,9 @@ describe Boards::Issues::MoveService, services: true do
...
@@ -58,9 +58,9 @@ describe Boards::Issues::MoveService, services: true do
end
end
end
end
context
'when moving from
done
'
do
context
'when moving from
closed
'
do
let
(
:issue
)
{
create
(
:labeled_issue
,
:closed
,
project:
project
,
labels:
[
bug
])
}
let
(
:issue
)
{
create
(
:labeled_issue
,
:closed
,
project:
project
,
labels:
[
bug
])
}
let
(
:params
)
{
{
board_id:
board1
.
id
,
from_list_id:
done
.
id
,
to_list_id:
list2
.
id
}
}
let
(
:params
)
{
{
board_id:
board1
.
id
,
from_list_id:
closed
.
id
,
to_list_id:
list2
.
id
}
}
it
'delegates the re-open proceedings to Issues::ReopenService'
do
it
'delegates the re-open proceedings to Issues::ReopenService'
do
expect_any_instance_of
(
Issues
::
ReopenService
).
to
receive
(
:execute
).
with
(
issue
).
once
expect_any_instance_of
(
Issues
::
ReopenService
).
to
receive
(
:execute
).
with
(
issue
).
once
...
...
spec/services/boards/lists/destroy_service_spec.rb
View file @
1fb9de2b
...
@@ -18,18 +18,18 @@ describe Boards::Lists::DestroyService, services: true do
...
@@ -18,18 +18,18 @@ describe Boards::Lists::DestroyService, services: true do
development
=
create
(
:list
,
board:
board
,
position:
0
)
development
=
create
(
:list
,
board:
board
,
position:
0
)
review
=
create
(
:list
,
board:
board
,
position:
1
)
review
=
create
(
:list
,
board:
board
,
position:
1
)
staging
=
create
(
:list
,
board:
board
,
position:
2
)
staging
=
create
(
:list
,
board:
board
,
position:
2
)
done
=
board
.
done
_list
closed
=
board
.
closed
_list
described_class
.
new
(
project
,
user
).
execute
(
development
)
described_class
.
new
(
project
,
user
).
execute
(
development
)
expect
(
review
.
reload
.
position
).
to
eq
0
expect
(
review
.
reload
.
position
).
to
eq
0
expect
(
staging
.
reload
.
position
).
to
eq
1
expect
(
staging
.
reload
.
position
).
to
eq
1
expect
(
done
.
reload
.
position
).
to
be_nil
expect
(
closed
.
reload
.
position
).
to
be_nil
end
end
end
end
it
'does not remove list from board when list type is
done
'
do
it
'does not remove list from board when list type is
closed
'
do
list
=
board
.
done
_list
list
=
board
.
closed
_list
service
=
described_class
.
new
(
project
,
user
)
service
=
described_class
.
new
(
project
,
user
)
expect
{
service
.
execute
(
list
)
}.
not_to
change
(
board
.
lists
,
:count
)
expect
{
service
.
execute
(
list
)
}.
not_to
change
(
board
.
lists
,
:count
)
...
...
spec/services/boards/lists/list_service_spec.rb
View file @
1fb9de2b
...
@@ -10,7 +10,7 @@ describe Boards::Lists::ListService, services: true do
...
@@ -10,7 +10,7 @@ describe Boards::Lists::ListService, services: true do
service
=
described_class
.
new
(
project
,
double
)
service
=
described_class
.
new
(
project
,
double
)
expect
(
service
.
execute
(
board
)).
to
eq
[
list
,
board
.
done
_list
]
expect
(
service
.
execute
(
board
)).
to
eq
[
list
,
board
.
closed
_list
]
end
end
end
end
end
end
spec/services/boards/lists/move_service_spec.rb
View file @
1fb9de2b
...
@@ -10,7 +10,7 @@ describe Boards::Lists::MoveService, services: true do
...
@@ -10,7 +10,7 @@ describe Boards::Lists::MoveService, services: true do
let!
(
:development
)
{
create
(
:list
,
board:
board
,
position:
1
)
}
let!
(
:development
)
{
create
(
:list
,
board:
board
,
position:
1
)
}
let!
(
:review
)
{
create
(
:list
,
board:
board
,
position:
2
)
}
let!
(
:review
)
{
create
(
:list
,
board:
board
,
position:
2
)
}
let!
(
:staging
)
{
create
(
:list
,
board:
board
,
position:
3
)
}
let!
(
:staging
)
{
create
(
:list
,
board:
board
,
position:
3
)
}
let!
(
:
done
)
{
create
(
:done
_list
,
board:
board
)
}
let!
(
:
closed
)
{
create
(
:closed
_list
,
board:
board
)
}
context
'when list type is set to label'
do
context
'when list type is set to label'
do
it
'keeps position of lists when new position is nil'
do
it
'keeps position of lists when new position is nil'
do
...
@@ -86,10 +86,10 @@ describe Boards::Lists::MoveService, services: true do
...
@@ -86,10 +86,10 @@ describe Boards::Lists::MoveService, services: true do
end
end
end
end
it
'keeps position of lists when list type is
done
'
do
it
'keeps position of lists when list type is
closed
'
do
service
=
described_class
.
new
(
project
,
user
,
position:
2
)
service
=
described_class
.
new
(
project
,
user
,
position:
2
)
service
.
execute
(
done
)
service
.
execute
(
closed
)
expect
(
current_list_positions
).
to
eq
[
0
,
1
,
2
,
3
]
expect
(
current_list_positions
).
to
eq
[
0
,
1
,
2
,
3
]
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment