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

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