Commit 20ff87a2 authored by Maxim Rydkin's avatar Maxim Rydkin

rename yet_another_users_finder into autocomplete_users_finder

parent 0c84713e
...@@ -6,7 +6,7 @@ class AutocompleteController < ApplicationController ...@@ -6,7 +6,7 @@ class AutocompleteController < ApplicationController
before_action :find_users, only: [:users] before_action :find_users, only: [:users]
def users def users
@users = YetAnotherUsersFinder.new(params: params, current_user: current_user, users: @users).execute @users = AutocompleteUsersFinder.new(params: params, current_user: current_user, users: @users).execute
render json: @users, only: [:name, :username, :id], methods: [:avatar_url] render json: @users, only: [:name, :username, :id], methods: [:avatar_url]
end end
......
class YetAnotherUsersFinder class AutocompleteUsersFinder
attr_reader :current_user, :users, :search, :skip_users, :page, attr_reader :current_user, :users, :search, :skip_users, :page,
:per_page, :author_id, :params :per_page, :author_id, :params
......
require 'spec_helper' require 'spec_helper'
describe YetAnotherUsersFinder do describe AutocompleteUsersFinder do
describe '#execute' do describe '#execute' do
let!(:user1) { create(:user, username: 'johndoe') } let!(:user1) { create(:user, username: 'johndoe') }
let!(:user2) { create(:user, :blocked, username: 'notsorandom') } let!(:user2) { create(:user, :blocked, username: 'notsorandom') }
......
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