spec/units/search_spec.rb in es-elasticity-0.2.1 vs spec/units/search_spec.rb in es-elasticity-0.2.2
- old
+ new
@@ -57,11 +57,11 @@
expect(docs.each.first).to eq expected[0]
expect(Array(docs)).to eq expected
end
it "searches the index and return active record models" do
- expect(index).to receive(:search).with(document_type, body.merge(_source: ["id"])).and_return(ids_response)
+ expect(index).to receive(:search).with(document_type, body.merge(_source: [])).and_return(ids_response)
relation = double(:relation,
connection: double(:connection),
table_name: "table_name",
klass: double(:klass, primary_key: "id"),
@@ -73,10 +73,10 @@
expect(subject.active_records(relation).mapping).to be relation
end
it "return relation.none from activerecord relation with no matches" do
- expect(index).to receive(:search).with(document_type, body.merge(_source: ["id"])).and_return(empty_response)
+ expect(index).to receive(:search).with(document_type, body.merge(_source: [])).and_return(empty_response)
relation = double(:relation)
expect(relation).to receive(:none).and_return(relation)
expect(subject.active_records(relation).mapping).to be relation