Skip to content

Commit 45bc132

Browse files
committed
Test for Kaminari crash when meilisearch disabled
1 parent 2488e26 commit 45bc132

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec/pagination/kaminari_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030
expect(p2).to contain_exactly(second)
3131
end
3232

33+
it "doesn't crash when meilisearch is disabled" do
34+
MeiliSearch::Rails.configuration[:active] = false
35+
36+
expect do
37+
Restaurant.search ''
38+
end.not_to raise_error
39+
40+
ensure
41+
MeiliSearch::Rails.configuration[:active] = true
42+
end
43+
3344
it 'returns number of total results' do
3445
hits = Restaurant.search ''
3546
expect(hits.total_count).to eq(2)

0 commit comments

Comments
 (0)