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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
973e8c0f
Commit
973e8c0f
authored
Jun 06, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated service spec
parent
e7b4eade
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
9 deletions
+33
-9
app/assets/javascripts/boards/components/modal/footer.js
app/assets/javascripts/boards/components/modal/footer.js
+2
-1
app/services/boards/lists/list_service.rb
app/services/boards/lists/list_service.rb
+1
-1
spec/services/boards/lists/list_service_spec.rb
spec/services/boards/lists/list_service_spec.rb
+30
-7
No files found.
app/assets/javascripts/boards/components/modal/footer.js
View file @
973e8c0f
...
...
@@ -26,7 +26,8 @@ gl.issueBoards.ModalFooter = Vue.extend({
},
methods
:
{
addIssues
()
{
const
list
=
this
.
modal
.
selectedList
||
this
.
state
.
lists
[
1
];
const
firstListIndex
=
1
;
const
list
=
this
.
modal
.
selectedList
||
this
.
state
.
lists
[
firstListIndex
];
const
selectedIssues
=
ModalStore
.
getSelectedIssues
();
const
issueIds
=
selectedIssues
.
map
(
issue
=>
issue
.
globalId
);
...
...
app/services/boards/lists/list_service.rb
View file @
973e8c0f
...
...
@@ -2,7 +2,7 @@ module Boards
module
Lists
class
ListService
<
BaseService
def
execute
(
board
)
board
.
lists
.
create
(
list_type: :backlog
)
unless
board
.
lists
.
backlog
.
any
?
board
.
lists
.
create
(
list_type: :backlog
)
unless
board
.
lists
.
backlog
.
exists
?
board
.
lists
end
...
...
spec/services/boards/lists/list_service_spec.rb
View file @
973e8c0f
require
'spec_helper'
describe
Boards
::
Lists
::
ListService
,
services:
true
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:board
)
{
create
(
:board
,
project:
project
)
}
let
(
:label
)
{
create
(
:label
,
project:
project
)
}
let!
(
:list
)
{
create
(
:list
,
board:
board
,
label:
label
)
}
let
(
:service
)
{
described_class
.
new
(
project
,
double
)
}
describe
'#execute'
do
it
"returns board's lists"
do
project
=
create
(
:empty_project
)
board
=
create
(
:board
,
project:
project
)
label
=
create
(
:label
,
project:
project
)
list
=
create
(
:list
,
board:
board
,
label:
label
)
context
'when the board has a backlog list'
do
before
do
create
(
:backlog_list
,
board:
board
)
end
it
'does not create a backlog list'
do
service
.
execute
(
board
)
expect
(
board
.
lists
.
merge
(
List
.
backlog
)).
to
eq
[
board
.
backlog_list
]
end
it
"returns board's lists"
do
expect
(
service
.
execute
(
board
)).
to
eq
[
board
.
backlog_list
,
list
,
board
.
closed_list
]
end
end
context
'when the board does not have a backlog list'
do
it
'creates a backlog list'
do
service
.
execute
(
board
)
service
=
described_class
.
new
(
project
,
double
)
expect
(
board
.
backlog_list
).
not_to
be
nil
end
expect
(
service
.
execute
(
board
)).
to
eq
[
board
.
backlog_list
,
list
,
board
.
closed_list
]
it
"returns board's lists"
do
expect
(
service
.
execute
(
board
)).
to
eq
[
board
.
backlog_list
,
list
,
board
.
closed_list
]
end
end
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