Commit 5623366f authored by Sean McGivern's avatar Sean McGivern

Merge branch '49011-board-user-finder-fix' into 'master'

Fix Boards::UsersFinder usage inside EE namespace

Closes #6865

See merge request gitlab-org/gitlab-ee!6438
parents f54cc799 5a7f36a6
......@@ -24,12 +24,12 @@ module EE
end
def find_user(board)
user_ids = user_finder(board).select(:user_id)
::User.where(id: user_ids).find(params[:assignee_id])
user_ids = user_finder(board).execute.select(:user_id)
::User.where(id: user_ids).find(params['assignee_id'])
end
def user_finder(board)
@user_finder ||= Boards::UsersFinder.new(board, current_user)
@user_finder ||= ::Boards::UsersFinder.new(board, current_user)
end
end
end
......
require 'spec_helper'
describe Boards::Lists::CreateService do
describe '#execute' do
let(:parent) { create(:project) }
let(:board) { create(:board, project: parent) }
let(:label) { create(:label, project: parent, name: 'in-progress') }
let(:user) { create(:user) }
let(:other_user) { create(:user) }
subject(:service) { described_class.new(parent, user, 'assignee_id' => other_user.id) }
before do
parent.add_developer(user)
parent.add_developer(other_user)
stub_licensed_features(board_assignee_lists: true)
end
it 'creates a new assignee list' do
list = service.execute(board)
expect(list.list_type).to eq('assignee')
expect(list).to be_valid
end
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