Merge commit '072112867b9a3ec090ad2c92d6363b47b2265d74' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2023-09-02 11:41:40 +02:00
34 changed files with 686 additions and 137 deletions
@@ -17,6 +17,7 @@ describe Admin::SystemCheck::ElasticsearchCheck do
allow(Chewy.client.indices).to receive_messages(get_mapping: {
AccountsIndex.index_name => AccountsIndex.mappings_hash.deep_stringify_keys,
StatusesIndex.index_name => StatusesIndex.mappings_hash.deep_stringify_keys,
PublicStatusesIndex.index_name => PublicStatusesIndex.mappings_hash.deep_stringify_keys,
InstancesIndex.index_name => InstancesIndex.mappings_hash.deep_stringify_keys,
TagsIndex.index_name => TagsIndex.mappings_hash.deep_stringify_keys,
}, get_settings: {
@@ -90,6 +91,7 @@ describe Admin::SystemCheck::ElasticsearchCheck do
allow(Chewy.client.indices).to receive(:get_mapping).and_return({
AccountsIndex.index_name => AccountsIndex.mappings_hash.deep_stringify_keys,
StatusesIndex.index_name => StatusesIndex.mappings_hash.deep_stringify_keys,
PublicStatusesIndex.index_name => PublicStatusesIndex.mappings_hash.deep_stringify_keys,
InstancesIndex.index_name => InstancesIndex.mappings_hash.deep_stringify_keys,
TagsIndex.index_name => TagsIndex.mappings_hash.deep_stringify_keys,
})
@@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'rails_helper'
describe Importer::PublicStatusesIndexImporter do
describe 'import!' do
let(:pool) { Concurrent::FixedThreadPool.new(5) }
let(:importer) { described_class.new(batch_size: 123, executor: pool) }
before { Fabricate(:status, account: Fabricate(:account, indexable: true)) }
it 'indexes relevant statuses' do
expect { importer.import! }.to update_index(PublicStatusesIndex)
end
end
end
+2 -2
View File
@@ -9,8 +9,8 @@ describe SearchQueryTransformer do
it 'sets attributes' do
transformer = described_class.new.apply(parser)
expect(transformer.should_clauses.first).to be_a(SearchQueryTransformer::TermClause)
expect(transformer.must_clauses.first).to be_nil
expect(transformer.should_clauses.first).to be_nil
expect(transformer.must_clauses.first).to be_a(SearchQueryTransformer::TermClause)
expect(transformer.must_not_clauses.first).to be_nil
expect(transformer.filter_clauses.first).to be_nil
end