Commit 90a3a0b383413532e5f4def6b10f32e4e7f2f4be
1 parent
23c58092
Exists in
master
and in
5 other branches
Reorganized tests [skip ci]
Showing
2 changed files
with
14 additions
and
12 deletions
Show diff stats
test/boost_test.rb
... | ... | @@ -19,16 +19,9 @@ class BoostTest < Minitest::Test |
19 | 19 | assert_order "zero", ["Zero Boost"], boost: "orders_count" |
20 | 20 | end |
21 | 21 | |
22 | - def test_conversions_weight | |
23 | - Product.reindex | |
24 | - store [ | |
25 | - {name: "Product Boost", orders_count: 20}, | |
26 | - {name: "Product Conversions", conversions: {"product" => 10}} | |
27 | - ] | |
28 | - assert_order "product", ["Product Conversions", "Product Boost"], boost: "orders_count" | |
29 | - end | |
22 | + # fields | |
30 | 23 | |
31 | - def test_boost_fields | |
24 | + def test_fields | |
32 | 25 | store [ |
33 | 26 | {name: "Red", color: "White"}, |
34 | 27 | {name: "White", color: "Red Red Red"} |
... | ... | @@ -36,7 +29,7 @@ class BoostTest < Minitest::Test |
36 | 29 | assert_order "red", ["Red", "White"], fields: ["name^10", "color"] |
37 | 30 | end |
38 | 31 | |
39 | - def test_boost_fields_decimal | |
32 | + def test_fields_decimal | |
40 | 33 | store [ |
41 | 34 | {name: "Red", color: "White"}, |
42 | 35 | {name: "White", color: "Red Red Red"} |
... | ... | @@ -44,7 +37,7 @@ class BoostTest < Minitest::Test |
44 | 37 | assert_order "red", ["Red", "White"], fields: ["name^10.5", "color"] |
45 | 38 | end |
46 | 39 | |
47 | - def test_boost_fields_word_start | |
40 | + def test_fields_word_start | |
48 | 41 | store [ |
49 | 42 | {name: "Red", color: "White"}, |
50 | 43 | {name: "White", color: "Red Red Red"} |
... | ... | @@ -53,7 +46,7 @@ class BoostTest < Minitest::Test |
53 | 46 | end |
54 | 47 | |
55 | 48 | # for issue #855 |
56 | - def test_boost_fields_apostrophes | |
49 | + def test_fields_apostrophes | |
57 | 50 | store_names ["Valentine's Day Special"] |
58 | 51 | assert_search "Valentines", ["Valentine's Day Special"], fields: ["name^5"] |
59 | 52 | assert_search "Valentine's", ["Valentine's Day Special"], fields: ["name^5"] | ... | ... |
test/conversions_test.rb
... | ... | @@ -45,4 +45,13 @@ class ConversionsTest < Minitest::Test |
45 | 45 | ] |
46 | 46 | assert_order "tomato", ["Tomato A", "Tomato B"] |
47 | 47 | end |
48 | + | |
49 | + def test_conversions_weight | |
50 | + Product.reindex | |
51 | + store [ | |
52 | + {name: "Product Boost", orders_count: 20}, | |
53 | + {name: "Product Conversions", conversions: {"product" => 10}} | |
54 | + ] | |
55 | + assert_order "product", ["Product Conversions", "Product Boost"], boost: "orders_count" | |
56 | + end | |
48 | 57 | end | ... | ... |