1 require "application_system_test_case"
3 class SearchTest < ApplicationSystemTestCase
4 test "click on 'where is this' sets search input value" do
5 stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?})
6 .to_return(:status => 404)
8 visit "/#map=7/1.234/6.789"
10 assert_field "Search", :with => ""
11 click_on "Where is this?"
12 assert_field "Search", :with => "1.234, 6.789"
15 test "query search link sets search input value" do
16 stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?})
17 .to_return(:status => 404)
19 visit search_path(:query => "2.341, 7.896")
21 assert_field "Search", :with => "2.341, 7.896"
24 test "latlon search link sets search input value" do
25 stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?})
26 .to_return(:status => 404)
28 visit search_path(:lat => "4.321", :lon => "9.876")
30 assert_field "Search", :with => "4.321, 9.876"