Commit cb722271 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'issue_321207' into 'master'

Rename Boards::ListService to Boards::BoardsFinder

See merge request gitlab-org/gitlab!55774
parents 671bfebb d5116adc
......@@ -21,13 +21,13 @@ class Groups::BoardsController < Groups::ApplicationController
def boards_finder
strong_memoize :boards_finder do
Boards::ListService.new(parent, current_user)
Boards::BoardsFinder.new(parent, current_user)
end
end
def board_finder
strong_memoize :board_finder do
Boards::ListService.new(parent, current_user, board_id: params[:id])
Boards::BoardsFinder.new(parent, current_user, board_id: params[:id])
end
end
......
......@@ -21,13 +21,13 @@ class Projects::BoardsController < Projects::ApplicationController
def boards_finder
strong_memoize :boards_finder do
Boards::ListService.new(parent, current_user)
Boards::BoardsFinder.new(parent, current_user)
end
end
def board_finder
strong_memoize :board_finder do
Boards::ListService.new(parent, current_user, board_id: params[:id])
Boards::BoardsFinder.new(parent, current_user, board_id: params[:id])
end
end
......
# frozen_string_literal: true
module Boards
class ListService < Boards::BaseService
class BoardsFinder < Boards::BaseService
def execute
find_boards
end
......
......@@ -13,7 +13,7 @@ module Resolvers
def resolve(id: nil)
return unless parent
::Boards::ListService.new(parent, context[:current_user], board_id: extract_board_id(id)).execute.first
::Boards::BoardsFinder.new(parent, context[:current_user], board_id: extract_board_id(id)).execute.first
rescue ActiveRecord::RecordNotFound
nil
end
......
......@@ -16,7 +16,7 @@ module Resolvers
return Board.none unless parent
::Boards::ListService.new(parent, context[:current_user], board_id: extract_board_id(id)).execute
::Boards::BoardsFinder.new(parent, context[:current_user], board_id: extract_board_id(id)).execute
rescue ActiveRecord::RecordNotFound
Board.none
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Boards::ListService do
RSpec.describe Boards::BoardsFinder do
it_behaves_like 'multiple boards list service' do
let(:parent) { create(:project, :empty_repo) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Boards::ListService do
RSpec.describe Boards::BoardsFinder do
describe '#execute' do
context 'when board parent is a project' do
let(:parent) { create(:project) }
......
......@@ -14,8 +14,8 @@ RSpec.describe Resolvers::BoardResolver do
expect(resolve_board(id: dummy_gid)).to eq nil
end
it 'calls Boards::ListService' do
expect_next_instance_of(Boards::ListService) do |service|
it 'calls Boards::BoardsFinder' do
expect_next_instance_of(Boards::BoardsFinder) do |service|
expect(service).to receive(:execute).and_return([])
end
......
......@@ -12,8 +12,8 @@ RSpec.describe Resolvers::BoardsResolver do
expect(resolve_boards).to eq []
end
it 'calls Boards::ListService' do
expect_next_instance_of(Boards::ListService) do |service|
it 'calls Boards::BoardsFinder' do
expect_next_instance_of(Boards::BoardsFinder) do |service|
expect(service).to receive(:execute)
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