about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-03-23 10:15:13 +0100
committerGitHub <noreply@github.com>2023-03-23 10:15:13 +0100
commit867790e07a149b1213936c3ff1fc5815d37e2e94 (patch)
treed165b5ba19e907a8e57b1abf5ab5cf408419e051 /spec
parent02ac94490a67659c7cc669ead5b107b724db6e68 (diff)
parentb4f60bc6de4ece3b2ff908d31a0c34ddbbfacf2c (diff)
Merge pull request #2144 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/importer/accounts_index_importer_spec.rb16
-rw-r--r--spec/lib/importer/statuses_index_importer_spec.rb16
-rw-r--r--spec/lib/importer/tags_index_importer_spec.rb16
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