Commit b759b2294d6742d5b046597cdb7cbd2a0a508a94

Authored by Andrew Kane
1 parent fc3753fc

Better load test [skip ci]

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
test/load_test.rb
1 1 require_relative "test_helper"
2 2  
3 3 class LoadTest < Minitest::Test
4   - def test_load_default
  4 + def test_default
5 5 store_names ["Product A"]
6 6 assert_kind_of Product, Product.search("product").first
7 7 end
8 8  
9   - def test_load_false
  9 + def test_false
10 10 store_names ["Product A"]
11   - assert_kind_of Hash, Product.search("product", load: false).first
  11 + assert_kind_of Searchkick::HashWrapper, Product.search("product", load: false).first
12 12 end
13 13  
14   - def test_load_false_methods
  14 + def test_false_methods
15 15 store_names ["Product A"]
16 16 assert_equal "Product A", Product.search("product", load: false).first.name
17 17 end
18 18  
19   - def test_load_false_with_includes
  19 + def test_false_with_includes
20 20 store_names ["Product A"]
21   - assert_kind_of Hash, Product.search("product", load: false, includes: [:store]).first
  21 + assert_kind_of Searchkick::HashWrapper, Product.search("product", load: false, includes: [:store]).first
22 22 end
23 23  
24   - def test_load_false_nested_object
  24 + def test_false_nested_object
25 25 aisle = {"id" => 1, "name" => "Frozen"}
26 26 store [{name: "Product A", aisle: aisle}]
27 27 assert_equal aisle, Product.search("product", load: false).first.aisle.to_hash
... ...