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
Jérome Perrin
gitlab-ce
Commits
4f45d113
Commit
4f45d113
authored
Aug 01, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `list_id` param to `id` in Boards::Lists::MoveService
parent
ed9943d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
app/services/boards/lists/move_service.rb
app/services/boards/lists/move_service.rb
+1
-1
spec/services/boards/lists/move_service_spec.rb
spec/services/boards/lists/move_service_spec.rb
+10
-10
No files found.
app/services/boards/lists/move_service.rb
View file @
4f45d113
...
...
@@ -21,7 +21,7 @@ module Boards
attr_reader
:board
,
:params
def
list
@list
||=
board
.
lists
.
find
(
params
[
:
list_
id
])
@list
||=
board
.
lists
.
find
(
params
[
:id
])
end
def
valid_move?
...
...
spec/services/boards/lists/move_service_spec.rb
View file @
4f45d113
...
...
@@ -14,7 +14,7 @@ describe Boards::Lists::MoveService, services: true do
context
'when list type is set to label'
do
it
'keeps position of lists when new position is nil'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
planning
.
id
,
position:
nil
})
service
=
described_class
.
new
(
project
,
{
id:
planning
.
id
,
position:
nil
})
service
.
execute
...
...
@@ -22,7 +22,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'keeps position of lists when new positon is equal to old position'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
planning
.
id
,
position:
1
})
service
=
described_class
.
new
(
project
,
{
id:
planning
.
id
,
position:
1
})
service
.
execute
...
...
@@ -30,7 +30,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'keeps position of lists when new positon is negative'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
planning
.
id
,
position:
-
1
})
service
=
described_class
.
new
(
project
,
{
id:
planning
.
id
,
position:
-
1
})
service
.
execute
...
...
@@ -38,7 +38,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'keeps position of lists when new positon is greater than number of labels lists'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
planning
.
id
,
position:
6
})
service
=
described_class
.
new
(
project
,
{
id:
planning
.
id
,
position:
6
})
service
.
execute
...
...
@@ -46,7 +46,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'increments position of intermediate lists when new positon is equal to first position'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
staging
.
id
,
position:
1
})
service
=
described_class
.
new
(
project
,
{
id:
staging
.
id
,
position:
1
})
service
.
execute
...
...
@@ -54,7 +54,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'decrements position of intermediate lists when new positon is equal to last position'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
planning
.
id
,
position:
4
})
service
=
described_class
.
new
(
project
,
{
id:
planning
.
id
,
position:
4
})
service
.
execute
...
...
@@ -62,7 +62,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'decrements position of intermediate lists when new position is greater than old position'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
planning
.
id
,
position:
3
})
service
=
described_class
.
new
(
project
,
{
id:
planning
.
id
,
position:
3
})
service
.
execute
...
...
@@ -70,7 +70,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'increments position of intermediate lists when new position is lower than old position'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
staging
.
id
,
position:
2
})
service
=
described_class
.
new
(
project
,
{
id:
staging
.
id
,
position:
2
})
service
.
execute
...
...
@@ -79,7 +79,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'keeps position of lists when list type is backlog'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
backlog
.
id
,
position:
2
})
service
=
described_class
.
new
(
project
,
{
id:
backlog
.
id
,
position:
2
})
service
.
execute
...
...
@@ -87,7 +87,7 @@ describe Boards::Lists::MoveService, services: true do
end
it
'keeps position of lists when list type is done'
do
service
=
described_class
.
new
(
project
,
{
list_
id:
done
.
id
,
position:
2
})
service
=
described_class
.
new
(
project
,
{
id:
done
.
id
,
position:
2
})
service
.
execute
...
...
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