Commit ce8568f5b32d7bd4766c1a3460f03926f04f9869
1 parent
21d10b40
Exists in
master
and in
21 other branches
Test select values
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
test/sql_test.rb
... | ... | @@ -281,7 +281,9 @@ class TestSql < Minitest::Unit::TestCase |
281 | 281 | |
282 | 282 | def test_select |
283 | 283 | store [{name: "Product A", store_id: 1}] |
284 | - assert_equal %w[id name store_id], Product.search("product", load: false, select: [:name, :store_id]).first.keys.reject{|k| k.start_with?("_") }.sort | |
284 | + result = Product.search("product", load: false, select: [:name, :store_id]).first | |
285 | + assert_equal %w[id name store_id], result.keys.reject{|k| k.start_with?("_") }.sort | |
286 | + assert_equal ["Product A"], result.name | |
285 | 287 | end |
286 | 288 | |
287 | 289 | # TODO see if Mongoid is loaded | ... | ... |