diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-03-22 19:50:11 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-03-22 19:50:11 +0100 |
commit | 5ac380c1226a8225a84835f6c70b7bdf00f99fb2 (patch) | |
tree | 432e2dce315060938ecc0ba05a9ae20fdb1da2d7 /spec/lib | |
parent | 02ac94490a67659c7cc669ead5b107b724db6e68 (diff) | |
parent | 2626097869c9520c21aaba73c9bcfe72c0f25f28 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/models/status.rb`: Upstream added lines close to a glitch-soc only line, not a real conflict. Applied upstream's changes (added hooks) while keeping glitch-soc's changes (`local_only` scope). - `config/environments/production.rb`: Upstream removed a header, while we have glitch-soc specific ones. Removed the header removed upstream.
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/importer/accounts_index_importer_spec.rb | 16 | ||||
-rw-r--r-- | spec/lib/importer/statuses_index_importer_spec.rb | 16 | ||||
-rw-r--r-- | spec/lib/importer/tags_index_importer_spec.rb | 16 |
3 files changed, 48 insertions, 0 deletions
diff --git a/spec/lib/importer/accounts_index_importer_spec.rb b/spec/lib/importer/accounts_index_importer_spec.rb new file mode 100644 index 000000000..73f9bce39 --- /dev/null +++ b/spec/lib/importer/accounts_index_importer_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe Importer::AccountsIndexImporter do + describe 'import!' do + let(:pool) { Concurrent::FixedThreadPool.new(5) } + let(:importer) { described_class.new(batch_size: 123, executor: pool) } + + before { Fabricate(:account) } + + it 'indexes relevant accounts' do + expect { importer.import! }.to update_index(AccountsIndex) + end + end +end diff --git a/spec/lib/importer/statuses_index_importer_spec.rb b/spec/lib/importer/statuses_index_importer_spec.rb new file mode 100644 index 000000000..d5e1c9f2c --- /dev/null +++ b/spec/lib/importer/statuses_index_importer_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe Importer::StatusesIndexImporter do + describe 'import!' do + let(:pool) { Concurrent::FixedThreadPool.new(5) } + let(:importer) { described_class.new(batch_size: 123, executor: pool) } + + before { Fabricate(:status) } + + it 'indexes relevant statuses' do + expect { importer.import! }.to update_index(StatusesIndex) + end + end +end diff --git a/spec/lib/importer/tags_index_importer_spec.rb b/spec/lib/importer/tags_index_importer_spec.rb new file mode 100644 index 000000000..348990c01 --- /dev/null +++ b/spec/lib/importer/tags_index_importer_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe Importer::TagsIndexImporter do + describe 'import!' do + let(:pool) { Concurrent::FixedThreadPool.new(5) } + let(:importer) { described_class.new(batch_size: 123, executor: pool) } + + before { Fabricate(:tag) } + + it 'indexes relevant tags' do + expect { importer.import! }.to update_index(TagsIndex) + end + end +end |