Commit 987f351b5397c38990c0d988b81d1235e01de6cd
1 parent
d889fa0a
Exists in
master
and in
17 other branches
Test unknown operator [skip ci]
Showing
1 changed file
with
7 additions
and
5 deletions
Show diff stats
test/where_test.rb
... | ... | @@ -77,17 +77,19 @@ class WhereTest < Minitest::Test |
77 | 77 | end |
78 | 78 | |
79 | 79 | def test_where_string_operators |
80 | - store [ | |
81 | - {name: "Product A", store_id: 1}, | |
82 | - {name: "Product B", store_id: 2} | |
83 | - ] | |
84 | - | |
85 | 80 | error = assert_raises RuntimeError do |
86 | 81 | assert_search "product", [], where: {store_id: {"lt" => 2}} |
87 | 82 | end |
88 | 83 | assert_includes error.message, "Unknown where operator" |
89 | 84 | end |
90 | 85 | |
86 | + def test_unknown_operator | |
87 | + error = assert_raises RuntimeError do | |
88 | + assert_search "product", [], where: {store_id: {ilike: "%2%"}} | |
89 | + end | |
90 | + assert_includes error.message, "Unknown where operator" | |
91 | + end | |
92 | + | |
91 | 93 | def test_regexp |
92 | 94 | store_names ["Product A"] |
93 | 95 | assert_search "*", ["Product A"], where: {name: /\APro.+\z/} | ... | ... |