File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,24 @@ def test_inspect
9090 assert_match "#<Searchkick::Relation [#<Product", Product.search("product").inspect
9191 end
9292
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+ end
101+
102+ def test_as_json
103+ store_names ["Product A", "Product B"]
104+ if mongoid?
105+ assert_equal Product.all.to_a.as_json, Product.search("product").as_json
106+ else
107+ assert_equal Product.all.as_json, Product.search("product").as_json
108+ end
109+ end
110+
93111 def test_to_yaml
94112 store_names ["Product A", "Product B"]
95113 if mongoid?
You can’t perform that action at this time.
0 commit comments