Skip to content

Commit 412b259

Browse files
eliskahpicandocodigo
authored andcommitted
[DSL] Remove a duplicate test
There is a completely identical test just above
1 parent cda0bb2 commit 412b259

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

spec/elasticsearch/dsl/search_spec.rb

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -328,58 +328,4 @@ def bool_query(obj)
328328
expect(s.to_hash).to eq(expected_hash)
329329
end
330330
end
331-
332-
describe '#collapse' do
333-
334-
let(:s) do
335-
search do
336-
query do
337-
match title: 'test'
338-
end
339-
collapse :user do
340-
max_concurrent_group_searches 4
341-
inner_hits 'last_tweet' do
342-
size 10
343-
from 5
344-
sort do
345-
by :date, order: 'desc'
346-
by :likes, order: 'asc'
347-
end
348-
end
349-
end
350-
end
351-
end
352-
353-
let(:inner_hits_hash) do
354-
{ name: 'last_tweet',
355-
size: 10,
356-
from: 5,
357-
sort: [ { date: { order: 'desc' } },
358-
{ likes: { order: 'asc' } }]
359-
}
360-
end
361-
362-
let(:expected_hash) do
363-
{ query: { match: { title: 'test' } },
364-
collapse: { field: :user,
365-
max_concurrent_group_searches: 4,
366-
inner_hits: inner_hits_hash } }
367-
end
368-
369-
it 'sets the field name' do
370-
expect(s.to_hash[:collapse][:field]).to eq(:user)
371-
end
372-
373-
it 'sets the max_concurrent_group_searches option' do
374-
expect(s.to_hash[:collapse][:max_concurrent_group_searches]).to eq(4)
375-
end
376-
377-
it 'sets the inner_hits' do
378-
expect(s.to_hash[:collapse][:inner_hits]).to eq(inner_hits_hash)
379-
end
380-
381-
it 'constructs the correct hash' do
382-
expect(s.to_hash).to eq(expected_hash)
383-
end
384-
end
385331
end

0 commit comments

Comments
 (0)