Commit 4ba24381 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '327106-remove-source_project_id-from-basic-search-for-merge-requests' into 'master'

Remove source_project_id from basic search for merge requests

See merge request gitlab-org/gitlab!67977
parents 858cb742 724b645a
...@@ -188,7 +188,7 @@ module Gitlab ...@@ -188,7 +188,7 @@ module Gitlab
merge_requests = MergeRequestsFinder.new(current_user, issuable_params).execute merge_requests = MergeRequestsFinder.new(current_user, issuable_params).execute
unless default_project_filter unless default_project_filter
merge_requests = merge_requests.in_projects(project_ids_relation) merge_requests = merge_requests.of_projects(project_ids_relation)
end end
apply_sort(merge_requests, scope: 'merge_requests') apply_sort(merge_requests, scope: 'merge_requests')
......
...@@ -148,13 +148,13 @@ RSpec.describe Gitlab::SearchResults do ...@@ -148,13 +148,13 @@ RSpec.describe Gitlab::SearchResults do
end end
end end
it 'includes merge requests from source and target projects' do it 'does not include merge requests from source projects' do
forked_project = fork_project(project, user) forked_project = fork_project(project, user)
merge_request_2 = create(:merge_request, target_project: project, source_project: forked_project, title: 'foo') merge_request_2 = create(:merge_request, target_project: project, source_project: forked_project, title: 'foo')
results = described_class.new(user, 'foo', Project.where(id: forked_project.id)) results = described_class.new(user, 'foo', Project.where(id: forked_project.id))
expect(results.objects('merge_requests')).to include merge_request_2 expect(results.objects('merge_requests')).not_to include merge_request_2
end end
describe '#merge_requests' do describe '#merge_requests' do
......
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