summaryrefslogtreecommitdiff
path: root/spec/views/search
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-18 19:00:14 +0000
commit05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch)
tree11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/views/search
parentec73467c23693d0db63a797d10194da9e72a74af (diff)
downloadgitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/views/search')
-rw-r--r--spec/views/search/_results.html.haml_spec.rb9
-rw-r--r--spec/views/search/show.html.haml_spec.rb2
2 files changed, 6 insertions, 5 deletions
diff --git a/spec/views/search/_results.html.haml_spec.rb b/spec/views/search/_results.html.haml_spec.rb
index e81462ee518..de994a0da2b 100644
--- a/spec/views/search/_results.html.haml_spec.rb
+++ b/spec/views/search/_results.html.haml_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'search/_results' do
+RSpec.describe 'search/_results', feature_category: :global_search do
using RSpec::Parameterized::TableSyntax
let_it_be(:user) { create(:user) }
@@ -11,7 +11,6 @@ RSpec.describe 'search/_results' do
let(:scope) { 'issues' }
let(:term) { 'foo' }
let(:search_results) { instance_double('Gitlab::SearchResults', { formatted_count: 10, current_user: user } ) }
- let(:search_service) { class_double(SearchServicePresenter, scope: scope, search: term, current_user: user) }
before do
controller.params[:action] = 'show'
@@ -20,6 +19,7 @@ RSpec.describe 'search/_results' do
create_list(:issue, 3)
allow(view).to receive(:current_user) { user }
+
assign(:search_count_path, 'test count link')
assign(:search_path, 'link test')
assign(:search_results, search_results)
@@ -27,8 +27,9 @@ RSpec.describe 'search/_results' do
assign(:search_term, term)
assign(:scope, scope)
- @search_service = SearchServicePresenter.new(SearchService.new(user, search: term, scope: scope))
- allow(@search_service).to receive(:search_objects).and_return(search_objects)
+ search_service_presenter = SearchServicePresenter.new(SearchService.new(user, search: term, scope: scope))
+ allow(search_service_presenter).to receive(:search_objects).and_return(search_objects)
+ assign(:search_service_presenter, search_service_presenter)
end
where(search_page_vertical_nav_enabled: [true, false])
diff --git a/spec/views/search/show.html.haml_spec.rb b/spec/views/search/show.html.haml_spec.rb
index 26ec2c6ae74..6adb2c77c4d 100644
--- a/spec/views/search/show.html.haml_spec.rb
+++ b/spec/views/search/show.html.haml_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe 'search/show', feature_category: :global_search do
stub_template "search/_category.html.haml" => 'Category Partial'
stub_template "search/_results.html.haml" => 'Results Partial'
- assign(:search_service, search_service_presenter)
+ assign(:search_service_presenter, search_service_presenter)
end
context 'search_page_vertical_nav feature flag enabled' do