Skip to content

Commit

Permalink
Fix linter problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ellnix committed Feb 23, 2024
1 parent b0248af commit 9c186c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
1 change: 0 additions & 1 deletion lib/meilisearch/rails/multi_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def multi_search(searches)
MultiSearchResult.new(searches, client.multi_search(search_parameters))
end


private

def normalize(options, index_target)
Expand Down
23 changes: 14 additions & 9 deletions spec/multi_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,31 @@
def reset_indexes
[Book, Color, Product].each do |klass|
klass.delete_all
klass.clear_index!
klass.clear_index!(true)
end
end

before { reset_indexes }

let!(:palm_pixi_plus) { Product.create!(name: 'palm pixi plus', href: 'ebay', tags: ['terrible']) }
let!(:steve_jobs) { Book.create! name: 'Steve Jobs', author: 'Walter Isaacson' }
let!(:blue) { Color.create!(name: 'blue', short_name: 'blu', hex: 0x0000FF) }
let!(:black) { Color.create!(name: 'black', short_name: 'bla', hex: 0x000000) }

before do
reset_indexes

Product.create! name: 'palm pixi plus', href: 'ebay', tags: ['terrible']
Product.create! name: 'lg vortex', href: 'ebay', tags: ['decent']
Product.create! name: 'palmpre', href: 'ebay', tags: ['discontinued', 'worst phone ever']
Product.reindex!

Color.create! name: 'blue', short_name: 'blu', hex: 0x0000FF
Color.create! name: 'black', short_name: 'bla', hex: 0x000000
Color.create! name: 'green', short_name: 'gre', hex: 0x00FF00

Book.create! name: 'Steve Jobs', author: 'Walter Isaacson'
Book.create! name: 'Moby Dick', author: 'Herman Melville'
end

let!(:palm_pixi_plus) { Product.find_by name: 'palm pixi plus' }
let!(:steve_jobs) { Book.find_by name: 'Steve Jobs' }
let!(:blue) { Color.find_by name: 'blue' }
let!(:black) { Color.find_by name: 'black' }

context 'with class keys' do
it 'returns ORM records' do
results = MeiliSearch::Rails.multi_search(
Expand Down Expand Up @@ -96,7 +101,7 @@ def reset_indexes
end

context 'with pagination' do
it 'it properly paginates each search' do
it 'properly paginates each search' do
MeiliSearch::Rails.configuration[:pagination_backend] = :kaminari

results = MeiliSearch::Rails.multi_search(
Expand Down

0 comments on commit 9c186c9

Please sign in to comment.