1 # frozen_string_literal: true
 
   3 require_relative "queries_controller_test"
 
   6   class NominatimReverseQueriesControllerTest < QueriesControllerTest
 
   8     # test all routes which lead to this controller
 
  11         { :path => "/search/nominatim_reverse_query", :method => :post },
 
  12         { :controller => "searches/nominatim_reverse_queries", :action => "create" }
 
  17       with_http_stubs "nominatim" do
 
  18         post search_nominatim_reverse_query_path(:lat => 51.7632, :lon => -0.0076, :zoom => 15), :xhr => true
 
  19         results_check :name => "Broxbourne, Hertfordshire, East of England, England, United Kingdom",
 
  20                       :lat => 51.7465723, :lon => -0.0190782,
 
  21                       :type => "node", :id => 28825933, :zoom => 15
 
  23         post search_nominatim_reverse_query_path(:lat => 51.7632, :lon => -0.0076, :zoom => 17), :xhr => true
 
  24         results_check :name => "Dinant Link Road, Broxbourne, Hertfordshire, East of England, England, EN11 8HX, United Kingdom",
 
  25                       :lat => 51.7634883, :lon => -0.0088373,
 
  26                       :type => "way", :id => 3489841, :zoom => 17
 
  28         post search_nominatim_reverse_query_path(:lat => 13.7709, :lon => 100.50507, :zoom => 19), :xhr => true
 
  29         results_check :name => "MM Steak&Grill, ถนนศรีอยุธยา, บางขุนพรหม, กรุงเทพมหานคร, เขตดุสิต, กรุงเทพมหานคร, 10300, ประเทศไทย",
 
  30                       :lat => 13.7708691, :lon => 100.505073233221,
 
  31                       :type => "way", :id => 542901374, :zoom => 19