From f09e59a96c2e97a8448852ba154eb494ad4e4cfb Mon Sep 17 00:00:00 2001 From: KMY Date: Tue, 12 Sep 2023 14:24:25 +0900 Subject: [PATCH] Fix tests --- app/services/search_service.rb | 2 +- spec/lib/search_query_transformer_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/search_service.rb b/app/services/search_service.rb index 2b28dfbecc5cf8..9e51b684a5413e 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -11,7 +11,7 @@ def call(query, account, limit, options = {}) @offset = options[:type].blank? ? 0 : options[:offset].to_i @resolve = options[:resolve] || false @following = options[:following] || false - @searchability = options[:searchability] || account.user&.setting_default_searchability_of_search.to_s || 'public' + @searchability = options[:searchability] || account&.user&.setting_default_searchability_of_search.to_s || 'public' default_results.tap do |results| next if @query.blank? || @limit.zero? diff --git a/spec/lib/search_query_transformer_spec.rb b/spec/lib/search_query_transformer_spec.rb index 5817e3d1d2015c..61aa36e1639d54 100644 --- a/spec/lib/search_query_transformer_spec.rb +++ b/spec/lib/search_query_transformer_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe SearchQueryTransformer do - subject { described_class.new.apply(parser, current_account: account) } + subject { described_class.new.apply(parser, current_account: account, searchability: :public) } let(:account) { Fabricate(:account) } let(:parser) { SearchQueryParser.new.parse(query) }