Commit 16ab6c83762740f925ab394e817fcdbd7fc129c2
1 parent
f2433604
Exists in
master
and in
21 other branches
Added test for multiple order fields
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
test/sql_test.rb
... | ... | @@ -138,6 +138,15 @@ class TestSql < Minitest::Unit::TestCase |
138 | 138 | assert_order "product", ["Product A", "Product B", "Product C", "Product D"], order: "name" |
139 | 139 | end |
140 | 140 | |
141 | + def test_order_multiple | |
142 | + store [ | |
143 | + {name: "Product A", color: "blue", store_id: 1}, | |
144 | + {name: "Product B", color: "red", store_id: 3}, | |
145 | + {name: "Product C", color: "red", store_id: 2} | |
146 | + ] | |
147 | + assert_order "product", ["Product A", "Product B", "Product C"], order: {color: :asc, store_id: :desc} | |
148 | + end | |
149 | + | |
141 | 150 | def test_partial |
142 | 151 | store_names ["Honey"] |
143 | 152 | assert_search "fresh honey", [] | ... | ... |