1 parent 8ed58ec commit 24db87eCopy full SHA for 24db87e
1 file changed
test/relation_test.rb
@@ -90,6 +90,24 @@ def test_inspect
90
assert_match "#<Searchkick::Relation [#<Product", Product.search("product").inspect
91
end
92
93
+ def test_to_json
94
+ store_names ["Product A", "Product B"]
95
+ if mongoid?
96
+ assert_equal Product.all.to_a.to_json, Product.search("product").to_json
97
+ else
98
+ assert_equal Product.all.to_json, Product.search("product").to_json
99
+ end
100
101
+
102
+ def test_as_json
103
104
105
+ assert_equal Product.all.to_a.as_json, Product.search("product").as_json
106
107
+ assert_equal Product.all.as_json, Product.search("product").as_json
108
109
110
111
def test_to_yaml
112
store_names ["Product A", "Product B"]
113
if mongoid?
0 commit comments