Rename `list_id` param to `id` in Boards::Lists::MoveService

parent ed9943d0
...@@ -21,7 +21,7 @@ module Boards ...@@ -21,7 +21,7 @@ module Boards
attr_reader :board, :params attr_reader :board, :params
def list def list
@list ||= board.lists.find(params[:list_id]) @list ||= board.lists.find(params[:id])
end end
def valid_move? def valid_move?
......
...@@ -14,7 +14,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -14,7 +14,7 @@ describe Boards::Lists::MoveService, services: true do
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
service = described_class.new(project, { list_id: planning.id, position: nil }) service = described_class.new(project, { id: planning.id, position: nil })
service.execute service.execute
...@@ -22,7 +22,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -22,7 +22,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'keeps position of lists when new positon is equal to old position' do 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 service.execute
...@@ -30,7 +30,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -30,7 +30,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'keeps position of lists when new positon is negative' do 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 service.execute
...@@ -38,7 +38,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -38,7 +38,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'keeps position of lists when new positon is greater than number of labels lists' do 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 service.execute
...@@ -46,7 +46,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -46,7 +46,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'increments position of intermediate lists when new positon is equal to first position' do 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 service.execute
...@@ -54,7 +54,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -54,7 +54,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'decrements position of intermediate lists when new positon is equal to last position' do 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 service.execute
...@@ -62,7 +62,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -62,7 +62,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'decrements position of intermediate lists when new position is greater than old position' do 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 service.execute
...@@ -70,7 +70,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -70,7 +70,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'increments position of intermediate lists when new position is lower than old position' do 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 service.execute
...@@ -79,7 +79,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -79,7 +79,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'keeps position of lists when list type is backlog' do 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 service.execute
...@@ -87,7 +87,7 @@ describe Boards::Lists::MoveService, services: true do ...@@ -87,7 +87,7 @@ describe Boards::Lists::MoveService, services: true do
end end
it 'keeps position of lists when list type is done' do 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 service.execute
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment