Commit ddbaca38 authored by Jonathan Schafer's avatar Jonathan Schafer

Check user for project_finder_similarity_sort feature

parent f684cd89
......@@ -52,7 +52,7 @@ class ProjectsFinder < UnionFinder
collection = Project.wrap_with_cte(collection) if use_cte
collection = filter_projects(collection)
if params[:sort] == 'similarity' && params[:search] && Feature.enabled?(:project_finder_similarity_sort)
if params[:sort] == 'similarity' && params[:search] && Feature.enabled?(:project_finder_similarity_sort, current_user)
collection.sorted_by_similarity_desc(params[:search])
else
sort(collection)
......
......@@ -353,7 +353,7 @@ RSpec.describe ProjectsFinder, :do_not_mock_admin_mode do
end
before do
stub_feature_flags(project_finder_similarity_sort: true)
stub_feature_flags(project_finder_similarity_sort: current_user)
end
it { is_expected.to eq([internal_project2, internal_project4, internal_project3]) }
......
......@@ -129,7 +129,7 @@ RSpec.describe Resolvers::ProjectsResolver do
let(:filters) { { search: 'projA', sort: 'similarity' } }
it 'returns projects in order of similarity to search' do
stub_feature_flags(project_finder_similarity_sort: true)
stub_feature_flags(project_finder_similarity_sort: current_user)
is_expected.to eq([named_project3, named_project1, named_project2])
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