Commit ace6fc43af56b92069a5e53c3ecc2a6bec2d1f78

Authored by Andrew Kane
1 parent 9fb6ba9b

Ensure order for more tests

Showing 1 changed file with 6 additions and 6 deletions   Show diff stats
test/sql_test.rb
... ... @@ -4,22 +4,22 @@ class TestSql < Minitest::Unit::TestCase
4 4  
5 5 def test_limit
6 6 store_names ["Product A", "Product B", "Product C", "Product D"]
7   - assert_search "product", ["Product A", "Product B"], order: {name: :asc}, limit: 2
  7 + assert_order "product", ["Product A", "Product B"], order: {name: :asc}, limit: 2
8 8 end
9 9  
10 10 def test_offset
11 11 store_names ["Product A", "Product B", "Product C", "Product D"]
12   - assert_search "product", ["Product C", "Product D"], order: {name: :asc}, offset: 2
  12 + assert_order "product", ["Product C", "Product D"], order: {name: :asc}, offset: 2
13 13 end
14 14  
15 15 def test_pagination
16 16 store_names ["Product A", "Product B", "Product C", "Product D", "Product E"]
17   - assert_search "product", ["Product C", "Product D"], order: {name: :asc}, page: 2, per_page: 2
  17 + assert_order "product", ["Product C", "Product D"], order: {name: :asc}, page: 2, per_page: 2
18 18 end
19 19  
20 20 def test_pagination_nil_page
21 21 store_names ["Product A", "Product B", "Product C", "Product D", "Product E"]
22   - assert_search "product", ["Product A", "Product B"], order: {name: :asc}, page: nil, per_page: 2
  22 + assert_order "product", ["Product A", "Product B"], order: {name: :asc}, page: nil, per_page: 2
23 23 end
24 24  
25 25 def test_where
... ... @@ -59,12 +59,12 @@ class TestSql < Minitest::Unit::TestCase
59 59  
60 60 def test_order_hash
61 61 store_names ["Product A", "Product B", "Product C", "Product D"]
62   - assert_search "product", ["Product D", "Product C", "Product B", "Product A"], order: {name: :desc}
  62 + assert_order "product", ["Product D", "Product C", "Product B", "Product A"], order: {name: :desc}
63 63 end
64 64  
65 65 def test_order_string
66 66 store_names ["Product A", "Product B", "Product C", "Product D"]
67   - assert_search "product", ["Product A", "Product B", "Product C", "Product D"], order: "name"
  67 + assert_order "product", ["Product A", "Product B", "Product C", "Product D"], order: "name"
68 68 end
69 69  
70 70 def test_partial
... ...