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

parent 0fb9210d
......@@ -20,7 +20,7 @@ module Boards
attr_reader :board, :params
def list
@list ||= board.lists.find(params[:list_id])
@list ||= board.lists.find(params[:id])
end
def decrement_higher_lists
......
......@@ -8,7 +8,7 @@ describe Boards::Lists::DestroyService, services: true do
context 'when list type is label' do
it 'removes list from board' do
list = create(:list, board: board)
service = described_class.new(project, list_id: list.id)
service = described_class.new(project, id: list.id)
expect { service.execute }.to change(board.lists, :count).by(-1)
end
......@@ -20,7 +20,7 @@ describe Boards::Lists::DestroyService, services: true do
staging = create(:list, board: board, position: 3)
done = create(:done_list, board: board)
described_class.new(project, list_id: development.id).execute
described_class.new(project, id: development.id).execute
expect(backlog.reload.position).to be_nil
expect(review.reload.position).to eq 1
......@@ -31,14 +31,14 @@ describe Boards::Lists::DestroyService, services: true do
it 'does not remove list from board when list type is backlog' do
list = create(:backlog_list, board: board)
service = described_class.new(project, list_id: list.id)
service = described_class.new(project, id: list.id)
expect { service.execute }.not_to change(board.lists, :count)
end
it 'does not remove list from board when list type is done' do
list = create(:done_list, board: board)
service = described_class.new(project, list_id: list.id)
service = described_class.new(project, id: list.id)
expect { service.execute }.not_to change(board.lists, :count)
end
......
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