From aa97c0fd12f130c4e6028a9a9361fea30bf86bca Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre <dbalexandre@gmail.com> Date: Mon, 1 Aug 2016 18:43:01 -0300 Subject: [PATCH] Rename `list_id` param to `id` in Boards::Lists::DestroyService --- app/services/boards/lists/destroy_service.rb | 2 +- spec/services/boards/lists/destroy_service_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/services/boards/lists/destroy_service.rb b/app/services/boards/lists/destroy_service.rb index 4e0b301277..5402d009c0 100644 --- a/app/services/boards/lists/destroy_service.rb +++ b/app/services/boards/lists/destroy_service.rb @@ -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 diff --git a/spec/services/boards/lists/destroy_service_spec.rb b/spec/services/boards/lists/destroy_service_spec.rb index 7c19dd36e3..620f9df739 100644 --- a/spec/services/boards/lists/destroy_service_spec.rb +++ b/spec/services/boards/lists/destroy_service_spec.rb @@ -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 -- 2.30.9