Commit 68e8e782b61d5f05ba1314dc909c1ac7015d0741
1 parent
375ba1d9
Exists in
master
and in
21 other branches
Moved autocomplete to separate test
Showing
2 changed files
with
20 additions
and
17 deletions
Show diff stats
... | ... | @@ -0,0 +1,20 @@ |
1 | +require_relative "test_helper" | |
2 | + | |
3 | +class TestAutocomplete < Minitest::Unit::TestCase | |
4 | + | |
5 | + def test_autocomplete | |
6 | + store_names ["Hummus"] | |
7 | + assert_search "hum", ["Hummus"], autocomplete: true | |
8 | + end | |
9 | + | |
10 | + def test_autocomplete_two_words | |
11 | + store_names ["Organic Hummus"] | |
12 | + assert_search "hum", [], autocomplete: true | |
13 | + end | |
14 | + | |
15 | + def test_autocomplete_fields | |
16 | + store_names ["Hummus"] | |
17 | + assert_search "hum", ["Hummus"], autocomplete: true, fields: [:name] | |
18 | + end | |
19 | + | |
20 | +end | ... | ... |
test/match_test.rb
... | ... | @@ -127,21 +127,4 @@ class TestMatch < Minitest::Unit::TestCase |
127 | 127 | assert_search "almondmilks", ["Almond Milk"] |
128 | 128 | end |
129 | 129 | |
130 | - # autocomplete | |
131 | - | |
132 | - def test_autocomplete | |
133 | - store_names ["Hummus"] | |
134 | - assert_search "hum", ["Hummus"], autocomplete: true | |
135 | - end | |
136 | - | |
137 | - def test_autocomplete_two_words | |
138 | - store_names ["Organic Hummus"] | |
139 | - assert_search "hum", [], autocomplete: true | |
140 | - end | |
141 | - | |
142 | - def test_autocomplete_fields | |
143 | - store_names ["Hummus"] | |
144 | - assert_search "hum", ["Hummus"], autocomplete: true, fields: [:name] | |
145 | - end | |
146 | - | |
147 | 130 | end | ... | ... |