File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
elasticsearch-model/test/integration Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,18 @@ class ::Article < ActiveRecord::Base
8181 end
8282 end
8383
84+ should "preserve the search results order for records" do
85+ response = Article . search ( 'title:code' )
86+
87+ response . records . each_with_hit do |r , h |
88+ assert_equal h . _id , r . id . to_s
89+ end
90+
91+ response . records . map_with_hit do |r , h |
92+ assert_equal h . _id , r . id . to_s
93+ end
94+ end
95+
8496 should "remove document from index on destroy" do
8597 article = Article . first
8698
Original file line number Diff line number Diff line change @@ -95,6 +95,18 @@ def as_indexed_json(options={})
9595 end
9696 end
9797
98+ should "preserve the search results order for records" do
99+ response = MongoidArticle . search ( 'title:code' )
100+
101+ response . records . each_with_hit do |r , h |
102+ assert_equal h . _id , r . id . to_s
103+ end
104+
105+ response . records . map_with_hit do |r , h |
106+ assert_equal h . _id , r . id . to_s
107+ end
108+ end
109+
98110 should "remove document from index on destroy" do
99111 article = MongoidArticle . first
100112
You can’t perform that action at this time.
0 commit comments