File tree 2 files changed +24
-0
lines changed
elasticsearch-model/test/integration
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
81
81
end
82
82
end
83
83
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
+
84
96
should "remove document from index on destroy" do
85
97
article = Article . first
86
98
Original file line number Diff line number Diff line change @@ -95,6 +95,18 @@ def as_indexed_json(options={})
95
95
end
96
96
end
97
97
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
+
98
110
should "remove document from index on destroy" do
99
111
article = MongoidArticle . first
100
112
You can’t perform that action at this time.
0 commit comments