Commit c0aefd16409127e1b728e34eead115992532065a
1 parent
8adf6ac1
Exists in
master
and in
18 other branches
Test negative boost [skip ci]
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
test/boost_test.rb
... | ... | @@ -149,6 +149,15 @@ class BoostTest < Minitest::Test |
149 | 149 | assert_order "tomato", ["Tomato C", "Tomato B", "Tomato A"], boost_where: {user_ids: [{value: 1, factor: 10}, {value: 3, factor: 20}]} |
150 | 150 | end |
151 | 151 | |
152 | + def test_boost_where_negative_boost | |
153 | + store [ | |
154 | + {name: "Tomato A"}, | |
155 | + {name: "Tomato B", user_ids: [2]}, | |
156 | + {name: "Tomato C", user_ids: [2]} | |
157 | + ] | |
158 | + assert_first "tomato", "Tomato A", boost_where: {user_ids: {value: 2, factor: 0.5}} | |
159 | + end | |
160 | + | |
152 | 161 | def test_boost_by_recency |
153 | 162 | store [ |
154 | 163 | {name: "Article 1", created_at: 2.days.ago}, | ... | ... |