##
# Test identification of US zipcodes
def test_identify_us_postcode
- [
- "12345",
- "12345-6789"
+ %w[
+ 12345
+ 12345-6789
].each do |code|
post :search, :params => { :query => code }
assert_response :success
assert_select "ul.results-list", 0
else
assert_select "ul.results-list", 1 do
- assert_select "p.search_results_entry", results.count
+ assert_select "li.search_results_entry", results.count
results.each do |result|
attrs = result.collect { |k, v| "[data-#{k}='#{v}']" }.join("")
- assert_select "p.search_results_entry a.set_position#{attrs}", result[:name]
+ assert_select "li.search_results_entry a.set_position#{attrs}", result[:name]
end
end
end